gregory semah
unread,Oct 6, 2011, 7:54:26 AM10/6/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi All,
I'm dealing with really weird problem
My model
class Projet(models.Model):
...
fact = models.PositiveIntegerField('Numéro de
Facture',null=True,blank=True)
...
...
A simple view from this model is
def facture(request, id=None):
projet = Projet.objects.all()
So as far as I am, everything worked as expected
Now I wanted to change
projet = Projet.objects.all() to projet =
Projet.objects.filter(fact=None)
it will send projet filtered as expected (all projects with no number
assigned to the fact field) to template
So the template display this as expected...
Now, when I want to filter only projets with a assigned number to the
fact field its return
NameError at /facture/
global name 'fact' is not defined
Have i missed something?
I'm used with this kind of operation with django , but right now I'm a
bit lost...
Thanks in advance
Gregory Sémah