HI,
Permissions in django.contrib.auth seem to be broken for me. I am
using the svn trunk version. It seems to have been like this for a
while.
In [21]: p = Permission.objects.get(codename='add_person')
In [22]: p.user_set.all()
Out[22]: []
In [23]: user = p.user_set.all()[0]
In [24]: user.ge
I am using a ModelChoiceField (default_project) in a form and want the
initial queyset to change when the form is created.
I've tried doing it like this:
forms.py --
class UserAccountForm(forms.Form):
.
default_project =
forms.ModelChoiceField(queryset=Project.objects.all(), requir
I am working with newforms and am wanting to set the class of the
produced with a ChoiceField using a RadioSelect widget. I assume it
should be something like this..
field = forms.ChoiceField(choices=CHOICES,
widget=forms.RadioSelect(attrs={'class': 'fun'}))
output would be
Field:
Choice
I am in the process of developing a stock ordering system.
I want the total field to be automatically calculated by quantity and
price fields
when i try and save an order item (in the admin interface) it says
please correct the errors below without highlighting any of the fields.
This is what i
Hi Jeff,
You'll need to add a __str__ method to your Status class as since it
doesn't have one it is only returning the object. If your familiar with
java its like a toString() method
class Status(models.Model):
Status = models.CharField(maxlength=50)
def __str__(self):
return sel
Hi again,
Firstly i would turn PythonDebug On,
Here is a sample of what i use in a production enviroment
maybe this might help.
Cheers,
Sam
SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonPath "['/path/to/python/code'] + sys.path"
SetE
I have a class with a "site" field that uses choices
I want to display the human readable name for it when being used as a
grouper
i thought something like
site.get_grouper_display or get_site.grouper_display
but that doesn't work
here is the template code
{% regroup object_list|dictsort:"grou
Can you tell us what your apache logs say?
hard to tell what is going on.
In the directory templates do you have your python code?
The way you've got it apache is expecting your settings file to be
/Users/kimvandenbroek/Sites/templates/mysite/settings.py
is that where it is?
Cheers,
Sam
On
I had this proble too. Heres how i solved it.
First i had a model method:
def get_wordcount(self):
return len(self.content.split())
(content is a TextField)
Then in my template i used it like this:
{{ object.content|truncatewords:60 }}
{% load base_utils %}
{% ifg
9 matches
Mail list logo