#21338: Can't use the same class name for proxy models
-------------------------------------+-------------------------------------
     Reporter:  srenskiy@…           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:  model                |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by srenskiy@…):

 Most likely you will never want to have same name for non-proxy models.
 Also it completely will brake Django models mechanism. That's why same
 name only for proxy models which are (by Liskov Principe) interchangeable
 in most cases. In other cases it's up to developer decide to use same
 names for proxy models or not.

 By "x" in x.A you mean module or app? Concrete models will never includes
 module name (only proxy): proxy_model_module = is_proxy and module or
 None. But you have point, in `register_models()` there are may be cases
 with lost proxy models (when concrete model overrides record of first
 occurred proxy model inheriting concrete one or another). I think this is
 repairable and testable. I'l try to do it later on this week.

 The need is simple: python supports it why Django not? It's more practical
 to have `app_store.Receipt` and `google_play.Receipt` then
 `app_store.AppStoreReceipt` and `google_play.GooglePlayReceipt`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21338#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/076.ec95506c3c4956e19d17fd0cb8267a3f%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to