Created
October 15, 2012 14:46
-
-
Save hanleybrand/3892866 to your computer and use it in GitHub Desktop.
A simplified listing of the Record model from rooibos/data/models.py
This file contains 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 Record(models.Model): | |
created = models.DateTimeField(auto_now_add=True) | |
modified = models.DateTimeField(auto_now=True) | |
name = models.SlugField(max_length=50, unique=True) | |
parent = models.ForeignKey('self', null=True, blank=True) | |
source = models.CharField(max_length=1024, null=True, blank=True) | |
manager = models.CharField(max_length=50, null=True, blank=True) | |
next_update = models.DateTimeField(null=True, blank=True) | |
owner = models.ForeignKey(User, null=True, blank=True) | |
# select methods (see actual source for code) | |
r = Record.objects.get(name='record.name') | |
r.get_absolute_url() | |
r.get_thumbnail_url() | |
r.get_image_url() | |
r.get_fieldvalues() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link to source:
https://github.com/cit-jmu/rooibos/blob/6e3b630832d610397ff561f2dfc6c394d12400e5/rooibos/data/models.py#L99