Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class KeyAction(models.Model):
- """Record of an action taken while using a key"""
- key = models.ForeignKey(Key, related_name='history', db_index=True)
- action = models.CharField(max_length=128, blank=False)
- notes = models.TextField(null=True)
- content_type = models.ForeignKey(ContentType)
- object_id = models.PositiveIntegerField()
- content_object = generic.GenericForeignKey('content_type', 'object_id')
- created = models.DateTimeField(auto_now_add=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement