We have an existing app written in perl with Postgre as DB.
I want to add the django admin as the interface to this existing DB.
The main app is in constant development, so the DB scheme may change
in the future.
I have checked the inspectdb output and it is quite good (I do also do
some automatic fixing of the results of inspectdb, but these fixes are
minor).
So, if we would only want to have the 'dumb' db editing tool, the
auto-generated models are OK.
But what we really want is adding some additional logic (such as
__unicode__ representations and save validations). Of course, it is
unacceptable to have this code in the auto-generated file, not is is
good to always manually insert it after every db scheme update (the
models file generated by inspectdb is 1000+ lines long).

What I have tried looked like
- have the models_auto.py file - the inspectdb patched output
- have the models_business_logic.py module looking like

from models_auto import *

Company_ = Company
del Company

class Company(Company_):
    def __unicode__(self):
        return '%s [%s]' % (self.nick, self.legal_name)

- have the models.py file simpli importing * from models_business_logic

But dues to inheritance mechanism and Foreign keys (or may be dues to
some other reasons) this approach do not work.
Any ideas?


Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to