Skip to content

Instantly share code, notes, and snippets.

@hanleybrand
Created October 15, 2012 14:46
Show Gist options
  • Save hanleybrand/3892866 to your computer and use it in GitHub Desktop.
Save hanleybrand/3892866 to your computer and use it in GitHub Desktop.
A simplified listing of the Record model from rooibos/data/models.py
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