Sure, Here you go,

class BItem(models.Model):

     #Date stuff
     created_on = models.DateTimeField(auto_now_add=True)
     last_edited_on = models.DateTimeField(auto_now=True)
     #Last Edited By
     last_edited_by = models.ForeignKey(User)

     #B information
     name = models.CharField(maxlength=1000)
     description = models.CharField(maxlength=6000)
     brewer = models.ForeignKey('BRItem')
     ingredients = models.ManyToManyField('IngredientItem')

     class Admin:
         pass

class PItem(models.Model):

     #Date stuff
     created_on = models.DateTimeField(auto_now_add=True)
     last_edited_on = models.DateTimeField(auto_now=True)
     #Last Edited By
     last_edited_by = models.ForeignKey(User)

     #P Information
     name = models.CharField(maxlength=1000)
     description = models.CharField(maxlength=6000)
     locations = models.ManyToManyField('PLocationItem')

     class Admin:
         pass

class PLocationItem(models.Model):

     #Date stuff
     created_on = models.DateTimeField(auto_now_add=True)
     last_edited_on = models.DateTimeField(auto_now=True)
     #Last Edited By
     last_edited_by = models.ForeignKey(User)

     #P Location Infromation
     street = models.CharField(maxlength=1000)
     city = models.CharField(maxlength=1000)
     state = models.USStateField()
     zipcode = models.IntegerField()

     class Admin:
         pass

class BRItem(models.Model):

     #Date stuff
     created_on = models.DateTimeField(auto_now_add=True)
     last_edited_on = models.DateTimeField(auto_now=True)
     #Last Edited By
     last_edited_by = models.ForeignKey(User)

     #BR information
     name = models.CharField(maxlength=1000)
     description = models.CharField(maxlength=6000)

-Mikeal


On Jun 7, 2006, at 7:31 PM, Malcolm Tredinnick wrote:

>
> Hi Mikeal,
>
> On Wed, 2006-06-07 at 19:17 -0700, Mikeal Rogers wrote:
>> Hiya,
>>
>> I'm using the django trunk and tried to generate the SQL for a model
>> I just wrote and got the following traceback;
>>
>>      execute_manager(settings)
>>    File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
>> python2.4/site-packages/django/core/management.py", line 1255, in
>> execute_manager
>>      execute_from_command_line(action_mapping, argv)
>>    File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
>> python2.4/site-packages/django/core/management.py", line 1222, in
>> execute_from_command_line
>>      output = action_mapping[action](mod)
>>    File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
>> python2.4/site-packages/django/core/management.py", line 116, in
>> get_sql_create
>>      final_output.extend(_get_many_to_many_sql_for_model(klass))
>>    File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
>> python2.4/site-packages/django/core/management.py", line 225, in
>> _get_many_to_many_sql_for_model
>>      table_output.append('    %s %s %s %s (%s),' % \
>> AttributeError: 'ManyToManyField' object has no attribute
>> 'm2m_column_name'
>>
>> I looked through the ManyToMany class for a minute and the
>> m2m_column_name assignments weren't removed or anything so I'm a bit
>> perplexed as to what the issue is.
>>
>> I'm using sqlite3.
>
> This is pretty unusual. Would you be able to post the model that is
> causing the problems? That might help debug it.
>
> Thanks,
> Malcolm
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to