Hello,

I'm trying to implement a ModelAdmin that uses the opposite of Inlines.
In this case the Inline field is the target of the foreign key, not the
model that has the foreign key reference. In my case, the foreign keys
allow NULL, because I'm using an external source to provide me with some
information that I can't directly tie to entities in my database.

An example would be stocktrading ID's associated with a companies. Since
you can't count on name matching to always work, some ID's will not
match a company. Some companies may not exist yet and I'd like to
provide some basic information as defaults for the new company that is
already available. Also, I'd like to use an autocomplete field, rather
then a select, since it's quite a bit of info.

Anyway - not to extend the example too much, I can't seem to find the
right hooks to implement and my biggest issues are:
1) formfield_for_dbfield() needs to return a FormField instance and the
actual form for the field is not a 'single entity', but quite an
involved formset.
2) inlines do some validation that the inline model has the correct
relationship with the parent form and cheating and ignoring that
validation will get you in trouble down the line when the form needs to
be saved.

I'm still reading the source and trying to find the right entrypointss,
but sure would appreciate some pointers or even "can't be done yet".
-- 
Melvyn Sopacua

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