Created
January 27, 2015 16:18
-
-
Save groovecoder/c8b4c187d8883d7b0964 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment