Skip to content

Instantly share code, notes, and snippets.

@Verurteilt
Created January 31, 2014 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Verurteilt/8726466 to your computer and use it in GitHub Desktop.
Save Verurteilt/8726466 to your computer and use it in GitHub Desktop.
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
class Log_Entry_General(models.Model):
mensaje = models.CharField()
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
object = Generic.ForeignKey('content_type', 'object_id')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment