Hello,

I am following the discussion in the ticket 
http://code.djangoproject.com/ticket/2145,
and I think its not correct place to discuss theoretical things in
ticket, instead discussion should be moved to a Groups (to either
Users or Developers. I post to Developers because the nature of ticket
is about developing Django itself).

I would like to ask: are there any practical way to extend your models
(DRY) ? What exactly is going on: I have build one e-commerce store
with Django. Then, I build 2nd, and 3rd and found that many parts are
similar, so there must be way to maintain some "core" part between
different installations, and write "custom" part for every
different customer needs.

May be I miss something, but the only obvious way to do that with
Django is to use OneToOne relationships.
So far, we had great success with this approach and actively actively
using 1:1 fields in our project (http://djwarehouse.org).

We understand the limitations of ORM and theoretical and practical
difficulties of implementing model inheritance.

But if we go back to real life requirements, we also need would like
to write reliable, easy to use and extend software, and we need it
now, not some years later, as some suggest in ticket system. Exactly,
what we need is:

 * keep general code common for all (Dont Repeat Yourself).
Practically, we maintain common code in one
    model, and custom code & data in  tied 1:1 model.

 * maintain good performance. AFIK it is only possible by using 1:1 OR
model inheretance.
   While MI is not started at al (?)l, OneToOne works excellently.

So far only 5 patches are needed, some are quick & ugly, but I did not
experienced any problems
with them: http://djwarehouse.org/browser/djWarehouse/trunk/docs/patches
during last year.

The only problem I see is the approach how things get fixed in trunk.
Most of those pathes & ideas
are refused by 2 reasons:

 * OneToOne fields will be soon depricated;
 * There are no need to fix Django /admin since newforms-admin is
coming.

Both things could be true, and some day they will became reality. But
current reality is different, neither model inheritance is ready, and
neither newforms-admin is functional yet.

I see Adrian added ticket http://code.djangoproject.com/ticket/24
which addresses same issue, but 10/19/05 rjwittams  said:

> This will happen "for free" when OneToOne? is moved to subclassing, as the 
> admin page would be generated
> from the dynamic type of the object.

And ticket was closed as: wontfix.

This is common for all our tickets we maintain in this area.

So, the question is: are there any other practical way to do the
things I explained easy, without using OneToOne fields?

Let me explain on example of that I need. Typical e-commerce store
have only Product title, description, price and rank fields. Custom
commerce store which sells books, have also ISBN code, authors,
publisher and other fields.

The only reliable and fast way would be to use OneToOne field to
connect custom attributes to main model.

Are people using different approaches? I can't believe that no-one is
writing appplications, which is being reused in some way. Most
probably, me, and some others are either using Django in some wrong
way, and miss something, or Django is not made to the purpose of code
reuse.

Please advice.

Best Regards,
   Alex


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to