Skip to content

Instantly share code, notes, and snippets.

@RodolfoSilva
Created December 17, 2015 12:47
Show Gist options
  • Save RodolfoSilva/9a7e02a23268ed8f5c32 to your computer and use it in GitHub Desktop.
Save RodolfoSilva/9a7e02a23268ed8f5c32 to your computer and use it in GitHub Desktop.
from django.db import models
class Categoria(models.Model):
nome = models.CharField(max_length=200)
slug = models.SlugField(unique=True, blank=True, null=True)
parent = models.ForeignKey('self', blank=True, null=True, related_name='child')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment