On 5/3/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > > On May 2, 2006, at 2:26 PM, Adrian Holovaty wrote: > > > On 4/24/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > >> I have created a Field called 'CTField' which will acts like a > >> regular > >> foreign key, but only fetches things which match the content_type as > >> well. > > > > Wow, I'm just now seeing this. If I'm understanding this correctly, > > this is a *very* cool addition! Are you willing to contribute this? > > Damn, this *is* super cool -- I've been trying to get something > similar working to no avail... > > Aa bit of pedantry: I think this should be called something like > GenericRelation instead of CTField -- took me a moment to figure out > what "CT" stood for. This:: > > class Story(Model): > > links = GenericRelation(RelatedLinks) > > looks super nice to me. > > So what exactly isn't working? I'll happily take a look and try to > finish it off if that's cool with you...
Cool with me (putting it in the trunk/you fixing it) ok.. the Reverse option isn't working.. at the moment it is expecting a 'content-type' field in the 'Story' .. which is wrong.. I just haven't gotten around to figuring out that part. I haven't tested adding/deleting stuff.. it should work.. but I haven't tried. the other concern is that it does a lookup on the content-type on every request.. I have another patch (1717) which would cache the content-type on the model --Ian > > Jacob > > > > -- [EMAIL PROTECTED] -- blog: http://feh.holsman.net/ -- PH: ++61-3-9818-0132 If everything seems under control, you're not going fast enough. - Mario Andretti --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---
