I have some Places and I have some Users in my database. I'd like to
be able to associate some Photos with each.
class Photo(models.Model):
# a model that represents a photo
class UserProfile(models.Model):
# has a list of Photos
class Place(models.Model):
# has a list of Photos
Normally, if i were using another ORM framework, I would make my Place
have a list of photos, and I'd make my UserProfile have a list of
photos, and I'd leave my Photo model alone. However, the Django way
of doing things requires that I put a ForeignKey into my Photo model
to establish the one-to-many.
The problem is, sometimes Photo's ForeignKey will point to a
UserProfile and sometimes to an Place. How can I have both my
UserProfile and Place models point to Photos?
Thanks in advance,
Mike
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---