Hello,

I am new to Django, so I apologize if I just don't get something.  I'd
appreciate being set straight.

I want to make a table that has as a ForeignKey a field from another
table.

 class Languages(models.Model):
    iso_code=models.CharField(
        maxlength=2,
        blank=False,
        primary_key=True)
    description=models.CharField(
        maxlength=72,
        blank=False)

class Keywords(models.Model):
    keyword=models.CharField(
        maxlength=72,
        blank=False,
        db_index=True,
        help_text="Keyword")
    iso_code=models.ForeignKey(
        Languages,
        related_name='keywords_fk_iso_code',
        default='en',
        help_text="Language of keyword")

But syncdb is loading the initialization .sql file for the second
before the first, resulting in the complaint that the iso_code is not
defined.

I see in the documentation that the order in which the initialization
files are loaded is not defined, so this is the documented behavior.
But I'm not seeing how it can make sense.  Am I missing a point?  Or
do I have to do the loading order by hand?

Thanks,
Jim
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to