Source

noodle-bucket / mercurial_data / models.py

from django.db import models

class Repository(models.Model):
    """A Mercurial repository on BitBucket."""
    
    user_name = models.CharField(
        max_length=100
    )
    repo_name = models.CharField(
        max_length=200
    )
    parent = models.ForeignKey(
        'self', null=True, blank=True
    )
    refreshed = models.DateTimeField(
        null=True, blank=True
    )
    
    created = models.DateTimeField(editable=False, auto_now_add=True)
    updated = models.DateTimeField(editable=False, auto_now=True)
    
    class Meta:
        ordering = ['-created']
        verbose_name_plural = "repositories"
    
    
    def __unicode__(self):
        return u"%s/%s" % (self.user_name, self.repo_name)