I have some apps app1, app2, .. appN and a special app for metadata.
The model metadata.Metadata should have ManyToManyFields to models (to
primary key, nothing fancy) in some of the other apps. I don't want to
have to update the models of the existing apps and the apps/models
shouldn't be hard-coded in the metadata-app in any way.

Now, one way I want very much to avoid is to make another app, let's
call it "glue", that hardcodes one model per wanted ManyToManyField
like so:

class GlueModel1Metadata(Model):
    model1 = ManyToManyField(Model1)
    metadata =  ManyToManyField(Metadata)

I've figured out how to "dynamically" create a Through-style model
(like the above) but I don't want them to be Through-style models.
(Dynamically is in quotes because I don't need to make tables at
runtime. Making them up front through syncdb is fine.)

Instead I'd rather register the models that need a manytomany to
Metadata and create all the connection tables in one fell swoop, via
syncdb, so I get that bit out of the way.

But... I'm stumped. The examples from AuditTrail at the wiki and the
revision history stuff in Pro Django is for full-blown models, not
ManyToMany tables. Besides, the models that are to use the audit
trail/history have that fact hardcoded in.


HM . o 0 ( monkey patch! )

-- 
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