Hi! I have this models:
class Project(models.Model):
users = models.ManyToManyField(User, through='Project_User')
class Project_User(models.Model):
project = models.ForeignKey('Project')
user = models.ForeignKey(User)
property = models.BooleanField()
Not all Projects have own Project_User rows.
Thing, what I need is ...
I know how to reload a regular Python module within a regular Python interpreter session. This question documents how to do that pretty well:
How do I unload (reload) a Python module?
For some reason, I am having trouble doing that within Django's "manage.py shell" interpreter session. To recreate my issue, start the basic Django tutor...
Second time asking more details ...
I'd like to have a project wide templagetags directory to have the common
tags used by all Apps, then each app can have their own tags if need so.
Let say that I have:
proj1/app1
proj1/app1/templatetags/app1_tags.py
proj1/app2
proj1/app2/templatetags/app2_tags.py
proj1/templatetags/proj1_tags.py
...
I'd like to go into Django with Python, but it seems that some hosting companies like DreamHost, Netfirms, they both offer Ruby on Rails in the basic hosting package, but not Django. They only list Python, but not the framework. So does that mean if I use Django, I will need to look for companies that support Django, or can I simply ad...
on save if user select certain option i want to take user to a page where he can have one more field to be filled and then redirect to admin default page
...
Can anyone share some pointers on building a Donations module for Satchmo? I'm comfortable customizing Satchmo's product models etc but unable to find anything related to Donations
I realize it's possible to create a Donations virtual product but as far as I can tell this still requires setting the amount beforehand ($5, $10 etc). I wan...
I have a web server with Django(Python programming language), hosted with Apache server. I would like to configure Google Appengine for the email server. My web server should be able to use Google Appengine, when it makes any email send using EmailMessage or sendmail infrastructure of Google mail api. I learnt that using remote_api I can...
I've written an entire app pretty successfully in Django but I have this nagging question that I think I know the answer to but I just want to make sure.
One of the things I really liked about Django was the data model and the ability to not have to do "obvious" stuff. For example, we use the admin interface extensively in our app. Th...
I'm confused by some behavior in Firebug.
I'm trying to update my CSS and I made changes to the actual CSS file and saved them.
If I update a directive on an existing selector, those changes will be rendered when I reload the page.
However, if I add a new class ( e.g. boxQuestion ), and create a new selector, it won't render at all.
T...
I'm trying to tie django-mptt and contrib.admin together by providing something friendlier than a flat list in the admin. Because the trees are supposed to be large (otherwise i wouldn't be using nested sets), users should be able to expand and collapse parts of it.
When a user expands or collapses or expands a branch (ajax is used for...
I have a couple of tables that are joined by GUIDs in SQL Server. Now, I've found a few custom fields to add support for GUIDs in django, but I tend to shy away from using code in blog posts if at all possible. I'm not going to do anything with the GUID other than join on it and maybe assign a GUID on new entries (although this is opti...
I am in the middle of developing a Django application, which has quite complicated models (it models a university - courses, modules, lectures, students etc.)
I have separated the project into apps, to make the whole thing more organised (apps are courses, schools, people, modules and timeperiods). I am having a problem whereby a model ...
Hi everyone,
A Django autofield when displayed using a formset is hidden by default. What would be the best way to show it?
At the moment, the model is declared as,
class MyModel:
locid = models.AutoField(primary_key=True)
...
When this is rendered using Django formsets,
class MyModelForm(ModelForm):
class Meta:
model ...
I have a few values that I would like to pass into a filter and get a URL out of it.
In my template I have:
{% if names %}
{% for name in names %}
<a href='{{name|slugify|add_args:"custid=name.id, sortid=2"}}'>{{name}}</a>
{%if not forloop.last %} | {% endif %}
{% endfor %}
{% endif %}
In my templatetags I have:
@registe...
The default Django's User model has some fields, and validation rules, that I don't really need. I want to make registration as simple as possible, i.e. require either email or username, or phone number - all those being unique, hence good as user identifiers.
I also don't like default character set for user name that is validated in D...
Alright, I know I've asked similar questions, but I feel this is hopefully a bit different. I'm integrating django.comments into my application, and the more I play with it, the more I realize it may not even be worth my while at the end of the day. That aside, I've managed to add Captcha to my comments, and I've learned that customizing...
Hi everyone,
I have a model MyModel which contains a PK - locid, that is an AutoField.
I want to construct a model formset from this, with some caveats:
The queryset for the formset should be a custom one (say, order_by('field')) rather than all()
Since locid for MyModel is an AutoField and thus hidden by default, I want to be able t...
Hi there,
I'm using ImageWithThumbnailsField from sorl to handle images on my project, without any problems.
Now I'd like to use PIL to generate images out of my text, in some cases that the user doesn't upload photos. I'm having a bad time trying to figure what is the code, so any help would be appreciated!
step 1. when user doesn't ...
I am having a status Field which has 3 options 1)activated 2)rejected 3)pending.If user select rejected status then he has to enter reason for rejection else that reason field should be hidden.Or when user choices rejected i should redirect it to some other form so that i can send email using the rejection reason
...
Hi, I wrote my own jquery plugin and was amazing that I haven't access to it inside $(document).ready function.
I write this testpage and was amazing more:
/**
* jQuery anchor plugin
*/
(function($) {
$.anchor = {
hashTrim: /^.*#/,
}
})(jQuery);
console.log($.ajax);
console.lo...