Yep, you can use a Related Model. So you might do it this way:
class Address(models.Model):
line1 = models.Charfield(maxlength=100)
line2 = models.Charfield(maxlength=100, blank=True, null=True)
city = models.Charfield(maxlength=100)
state = models.Charfield(maxlength=2)
country = models.Charfield(maxlength=100)
zip = models.Charfield(maxlength=20)
class UseProfile(models.Model):
shipping_address = models.OneToOneField(Address)
billing_address = models.OneToOneField(Address)
Check out: http://www.djangoproject.com/documentation/models/one_to_one/
for more info on using OneToOne fields.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---