On Tue, 2007-05-08 at 14:32 +0800, Russell Keith-Magee wrote:
> On 5/8/07, Suraj <[EMAIL PROTECTED]> wrote:
[...]
> >     Will same problem occur for ManyToMany fields? I have not started
> > creating models of those tables yet. But the database has it's own
> > naming convention for relationship tables used for holding ManyToMany
> > fields.
> 
> The same problem will exist, but at present, there is only a partial solution.
> 
> You can specify an alternate name for the m2m table using the db_table
> argument; however, the column names on this table cannot currently be
> modified.
> 
> If you're feeling enthusiastic, a fix to overcome this limitation
> would be accepted, and shouldn't be too difficult to write. Look at
> django.db.models.field.related.ManyToManyField, follow the lead of the
> _get_m2m_db_table(), and modify the _get_m2m_column_name() and
> _get_m2m_reverse_name() methods. Don't forget to include plenty of
> unit tests to validate your behaviour :-)

There's already a ticket open waiting for the patch, too. :-)

Ticket #785 is for this feature and you might want to have a read of the
existing comments there before getting started. I agree with Russell,
it's definitely a good idea and a decent patch will be accepted.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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