Re: [Django] #15123: models Meta's db_table and ManyToManyField

2011-01-21 Thread Django
#15123: models Meta's db_table  and ManyToManyField
--+-
  Reporter:  ctao | Owner:   
Status:  closed   | Milestone:  1.3  
 Component:  ORM aggregation  |   Version:  1.3-alpha
Resolution:  invalid  |  Keywords:   
 Stage:  Unreviewed   | Has_patch:  0
Needs_docs:  0|   Needs_tests:  0
Needs_better_patch:  0|  
--+-
Changes (by russellm):

  * status:  new => closed
  * needs_better_patch:  => 0
  * resolution:  => invalid
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 This can be achieved by defining a custom m2m-through model, and defining
 the db_column attribute on the FK fields.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



[Django] #15123: models Meta's db_table and ManyToManyField

2011-01-19 Thread Django
#15123: models Meta's db_table  and ManyToManyField
-+--
 Reporter:  ctao |   Owner:
   Status:  new  |   Milestone:  1.3   
Component:  ORM aggregation  | Version:  1.3-alpha 
 Keywords:   |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 Given both models as follows:

 {{{
 class P(AuditModel):
 description = models.CharField(max_length=50, unique=True)

 class Meta:
 db_table = 'P'

 class XSummary(AuditModel):
 p = models.ManyToManyField(P, blank = True, null = True, )

 class Meta:
 db_table = 'Summary'
 }}}

 The 2 models with cutomized db_table name will generate a relationship
 table as follows:

 {{{
 CREATE TABLE "SUMMARY_P" (
 "ID" NUMBER(11) NOT NULL PRIMARY KEY,
 "XSUMMARY_ID" NUMBER(11) NOT NULL,
 "P_ID" NUMBER(11) NOT NULL REFERENCES "P" ("ID") DEFERRABLE INITIALLY
 DEFERRED,
 )
 ;

 }}}

 Now you can see that the table name "SUMMARY_P" combined the cutomized
 db_table name of both models. But the field "XSUMMARY_ID" still take the
 mode name -- "XSUMMARY", not the db_table "SUMMARY". Franckly, I would
 like to have the field "XSUMMARY_ID" as "field "SUMMARY_ID".

 Any feedback or fix on the issue ?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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