Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion proposal for lazy foreignkeys
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Luke Plant  
View profile  
 More options Sep 27 2010, 11:46 am
From: Luke Plant <L.Plant...@cantab.net>
Date: Mon, 27 Sep 2010 16:46:03 +0100
Local: Mon, Sep 27 2010 11:46 am
Subject: Re: proposal for lazy foreignkeys

On Mon, 2010-09-27 at 11:36 +0200, Patryk Zawadzki wrote:

> With the risk of being ignored once again, I dare to link to a working
> solution that does not need any changed to the framework itself (other
> than perhaps including the factory class):

> http://gist.github.com/584106

This looks rather good to me.  It may have been ignored before because
it has no comments and some things are not immediately obvious.  For
example, you are basically proposing that the concrete models are passed
into view functions via URLconf, and from there are passed into any
functions which need them, and so they would never actually need to be
imported by the app that defines the abstract model.

I for one would be much happier to not add any more machinery via Meta
options. With some cleanup, and some documentation of this pattern, and
possibly a better name, I think the AbstractMixin class you propose
could be a good candidate for inclusion in core.

Some notes:
1) it seems like line 15 in abstract.py should say 'abstract':'False',
not 'True' - did I miss something?

2) there would need to be some way of merging the concrete class's own
Meta options with the abstract class's Meta options

3) why do we need the _classcache?  Is the key used specific enough -
what if two different apps both create 'MyCategory' based on
'CategoryFactory', using them in different situations?

Thanks,

Luke

--
"Christ Jesus came in to the world to save sinners" (1 Timothy 1:15)

Luke Plant || http://lukeplant.me.uk/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.