Hi, i've this code:
from django.db import models
class Entry(models.Model):
title = models.CharField(max_length=30,null=False)
body_text = models.TextField(max_length=255)
author = models.ForeignKey(User)
def __unicode__(self):
return self.title
class Meta:
ordering = ('title',)
class User(models.Model):
nick = models.CharField(max_length=25)
pwd = models.CharField(max_length=50)
entries = models.ManyToManyField(Entry)
So, i have a model "Entry" that have a field of type User called "author". The problem is that the User model not been created yet, so when i run syncdb
i get an error.
Can anybody help me to fix this problem ?