Hey Tim,
Yeah, I understand what you mean, but I thought that django used "" by
default and not NULL. That's why I defined in my model to allow blank,
and not include null=True.
Part of the model is this:
class Factor(meta.Model):
20 first_name = meta.CharField(maxlength=25)
21 last_name = meta.CharField(maxlength=25)
22 email = meta.EmailField(blank=True)
23 phone = meta.IntegerField(blank=True)
24 cell_phone = meta.IntegerField(blank=True)
25 address = meta.CharField(maxlength=25, blank=True)
26
27 def __repr__(self): return self.last_name
28
29 class META:
30 admin = meta.Admin()
31
32 class Company(meta.Model):
33 name = meta.CharField(maxlength=25)
34 phone = meta.CharField(maxlength=25, blank=True)
35 factor = meta.ForeignKey(Factor, blank=True)
36
37 def __repr__(self): return self.name
38
39 class META:
40 db_table = 'products_companies'
41 verbose_name_plural = 'companies'
42 admin = meta.Admin(
43 list_display = ('name', 'phone',
'factor'),
44 )
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---