Skip to content

Instantly share code, notes, and snippets.

@nehajagadeesh
Created March 7, 2018 14:18
Show Gist options
  • Save nehajagadeesh/db8623207a9c29b746d3233a6f415254 to your computer and use it in GitHub Desktop.
Save nehajagadeesh/db8623207a9c29b746d3233a6f415254 to your computer and use it in GitHub Desktop.
Common Models
# Example:
# from custom_user import CustomUser
# from custom_contenttype import CustomContentType
# from custom_genericcontenttypes import CustomGenericForeignKey
class Notes(models.Model):
notes = models.TextField()
createdon = models.DateTimeField(auto_now_add=True)
modifiedon = models.DateTimeField(auto_now=True)
user = models.ForeignKey(CustomUser)
content_type = models.ForeignKey(CustomContentType)
object_id = models.PositiveIntegerField()
content_object = CustomGenericForeignKey('content_type', 'object_id')
class Meta:
app_label = 'goibibo_models'
db_table = 'common_itemnotes'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment