On Fri, Aug 16, 2013 at 7:45 AM, Russell Keith-Magee <
[email protected]> wrote:

>
> 8. I've added a new check. If you're using a `GenericRelation` but there
>> is no
>> `GenericForeignKey` on the target model, an warning is raised. This check
>> was
>> implemented in this commit [9]. It uses `vars` builtin function to check
>> if the
>> target model has a `GenericForeignKey`. This is ugly, but I don't see a
>> better
>> approach.
>>
>> [9]
>> https://github.com/chrismedrela/django/commit/ab65ff2b6d6346407a11a72c072e358c7b518cf9#L1R397
>>
>
> Hrm. I don't really like this, but I'm not sure I have a better option. A
> better approach would be to have GFKs turn up in get_fields, but it isn't
> your responsibility to fix the internal problems of Generic Foreign Keys.
> If we have to live with this, then we should at the very least document it
> as a FIXME, pointing at the underlying problem with _meta handling of GFKs.
>
>

Michal Petruca just mailed the django-dev list with some discussion about
changes he wants to make in his own GSoC project, which drew my attention
to something I'd forgotten about.

Does _meta.virtual_fields -- contain the information you need? It looks
like it should.

Russ %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to