При запуске кода:
class MenuItem(models.Model):
menu = models.ForeignKey(
Menu,
verbose_name = _('menu'),
)
parent = models.ForeignKey(
'self',
verbose_name = _('parent'),
related_name = u'child',
blank = True,
null = True,
)
name = models.CharField(
max_length = 150,
verbose_name = _('name'),
)
uri = models.SlugField(
verbose_name = _('URL'),
help_text = _('If you do not want to connect this item to your models, you can specify a URL explicitly'),
blank = True,
null = True,
)
visible = models.CharField(
max_length = 1,
verbose_name = _('visible'),
choices = CHOICES_VISIBLE,
default = CHOICES_VISIBLE[0][0],
)
css_class = models.CharField(
max_length = 50,
verbose_name = _('CSS class'),
help_text = u'',
blank = True,
null = True,
)
class Meta:
verbose_name = _('menu item')
verbose_name_plural = _('menu items')
def get_absolute_url(self):
return '/%s' % self.uri
def __unicode__(self):
return self.name
Появляется ошибка:
class MenuItem(models.Model):
File "/Users/v/Documents/app1/mysite/menu/models.py", line 36, in MenuItem
verbose_name = _('menu'),
TypeError: __init__() missing 1 required positional argument: 'on_delete'