No progress so far. I know I can do this:

        attrs[field.name] = copy.copy(field)
        if attrs[field.name].rel:
                attrs[field.name].rel.related_name = "audit_%s_%s" % 
(cls.__name__,
field.name)

But this doesn't seem to make a difference. I still get:

        Error: One or more models did not validate:
        box.testaudit: Accessor for field 'author' clashes with related field
'User.audit_Test_author'. Add a related_name argument to the
definition for 'author'.
        box.testaudit: Reverse query name for field 'author' clashes with
related field 'User.audit_Test_author'. Add a related_name argument to
the definition for 'author'.
        box.test: Accessor for field 'author' clashes with related field
'User.audit_Test_author'. Add a related_name argument to the
definition for 'author'.
        box.test: Reverse query name for field 'author' clashes with related
field 'User.audit_Test_author'. Add a related_name argument to the
definition for 'author'.

Is it possible to override the related_name attribute at runtime?

On Dec 4, 9:04 am, Stodge <sto...@gmail.com> wrote:
> I'm playing around with the Audit code here:
>
>    http://code.djangoproject.com/wiki/AuditTrail
>
> The Caveats section mentions:
>
>     Likewise, it fails when there are multiple ForeignKeys? pointing
> to the same Model, as it doesn't support / compensate for
> related_name.
>
> Does anyone know if this caveat was ever addressed or how to do it?
>
> Thanks

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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