Hi,

I have models.py like this:

class Media_biz(models.Model):
    ---
    default = models.BooleanField("Default", blank=True, null=True)
    ---

def get_default_Media_biz():
    if Media_biz.objects.filter(default=True).count() != 0:
        return Media_biz.objects.filter(default=True)[0]
    else:
        return None

class Metadata(models.Model):
    ---
    media_biz = models.ForeignKey('Media_biz',
default=get_default_Media_biz)
    ---

What I want is to set the default value of Media_biz in Metadata. The
problem is:
When I create a new database and run syncdb, I get:
psycopg2.ProgrammingError: relation "cms_sample_media_biz" does not
exist

How can I check that the Media_biz table exist in the database?

Thanks, Arshavski Alexander.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to