mediapop / django-friendface

Getting Facebook to work for Django.
2 stars 0 forks source link

How to relate FacebookUser to FacebookEvent. #67

Open kitsunde opened 11 years ago

kitsunde commented 11 years ago

An event can have a user, application or page as an owner. So say we have:

class FacebookEvent(models.Model):
    #@todo Venue
    id = models.BigIntegerField(primary_key=True)
    content_type = models.ForeignKey(ContentType, blank=True, null=True)
    object_id = models.PositiveIntegerField(blank=True, null=True)
    owner = generic.GenericForeignKey('content_type', 'object_id')