Re: Blank and null values for a foreign key

2008-10-13 Thread Fabio Natali
Thanks to Gerard and Karen for their kind and precious help. Karen Tracey wrote: [...] > The inability to sort blank=True,null=True ForeignKey columns has > been fixed (post 1.0): I switched to trunk and now everythink is fine! I'm veeery happy this sorting issue has been fixed. All the best to

Re: Blank and null values for a foreign key

2008-10-12 Thread Karen Tracey
On Sun, Oct 12, 2008 at 5:45 AM, Fabio Natali <[EMAIL PROTECTED]>wrote: > > ... > As you can see, a new person can be added with no license at all: > "blank=True,null=True" options. That's what I want. > > In my admin panel I get the list of all the persons I have added. I > wish I could filter or

Re: Blank and null values for a foreign key

2008-10-12 Thread Gerard Petersen
Fabio, If you define de foreignkey in the license model, you can create persons without a problem. The only requirement then for creating a license would be that it needs an existing person. Something like this: class Person(models.Model): name = models.CharField(max_length=30) clas

Blank and null values for a foreign key

2008-10-12 Thread Fabio Natali
Hi all! I have two models, Person and License. class License(models.Model): number = models.IntegerField(max_length=10) class Person(models.Model): name = models.CharField(max_length=30) license = models.ForeignKey(License,verbose_name="Centro di costo",blank=True,null=