Skip to content

Instantly share code, notes, and snippets.

@gusano
Created September 20, 2011 15:17
Show Gist options
  • Save gusano/1229379 to your computer and use it in GitHub Desktop.
Save gusano/1229379 to your computer and use it in GitHub Desktop.
django Model example
class Category(models.Model):
"""Category for posts"""
name = models.CharField(max_length=50)
has_children = models.BooleanField(default=0)
is_sub = models.BooleanField(default=0)
parent = models.CharField(max_length=50, null=True, blank=True)
position = models.IntegerField()
visible = models.BooleanField(default=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment