Re: DescriptorFields status/Manager API change

2006-01-25 Thread Jacob Kaplan-Moss
On Jan 25, 2006, at 9:57 PM, Adrian Holovaty wrote: I've written up my latest proposal here: http://code.djangoproject.com/wiki/DescriptorFields Yum! I agree with Joseph -- I like this new syntax a *lot*. I do have a few semantic questions, though. WARNING: Much nit- picking follows; I sh

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Joseph Kocherhans
On 1/25/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > > Also, it would be cool if the _set stuff wasn't forced on us, there's > > a disconnect between creating an attribute called 'sites' in your > > model, and accessing that attrib

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Adrian Holovaty
On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > One question though... it doesn't say anything about accessing fields > via the class anymore. Is that still the plan? Article.sites, > Article.reporter, etc would return the field object, and > article_obj.site_set returns a manager. Yea

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Joseph Kocherhans
On 1/25/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > I've written up my latest proposal here: > > http://code.djangoproject.com/wiki/DescriptorFields > > It turns out related-object lookup can cleanly use the manager API. > Thoughts? If there are no big objections, let's start converting the

Re: magic-removal: "Change subclassing syntax"

2006-01-25 Thread Max Battcher
Joseph Kocherhans wrote: The wiki doesn't say a whole lot about it, although it's probably in someone's brain ;) I'm wondering about the ETA of this as well. I could use a good subclassing system for my project *today*, particularly because as far as I can tell the One-To-One relationship i

Re: Bulk delete - lets try this again...

2006-01-25 Thread Russell Keith-Magee
On 1/26/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 1/25/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > Comments on this thread seem to have gone dead - are there any > > objections out there to me committing this patch (the newer patch with > > object delete deferring to the man

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Adrian Holovaty
I've written up my latest proposal here: http://code.djangoproject.com/wiki/DescriptorFields It turns out related-object lookup can cleanly use the manager API. Thoughts? If there are no big objections, let's start converting the magic-removal unit tests to use this new syntax, and I'll start im

Re: magic-removal: "Change subclassing syntax"

2006-01-25 Thread Max Battcher
Jeremy Dunck wrote: This makes me think the world needs a wiki whose wikitext syntax is restructured text. Anybody know of one? I've seen a home-brew Zope-based one. It would be real quick to build one as a django app... In fact its own my personal project todo list. How soon do you want

Re: Bulk delete - lets try this again...

2006-01-25 Thread Adrian Holovaty
On 1/25/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > Comments on this thread seem to have gone dead - are there any > objections out there to me committing this patch (the newer patch with > object delete deferring to the manager)? Yeah -- I'm not 100% comfortable with coupling object ins

Re: broken tests after pluralization removal [2111]

2006-01-25 Thread Russell Keith-Magee
On 1/26/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > On 1/25/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > Hmmm, that's the reverse lookup that was just recently added, right? I > > guess it makes sense to change the tests... > Place.objects.get_object(restaurants__place__exact=1) #

Re: Ajax again

2006-01-25 Thread Juan Maiz
Hi Leonardo, i am.On 1/26/06, Leonardo Santagada <[EMAIL PROTECTED]> wrote: I am asking this because I am choosing the tools for my next project.The frameworks I am looking at are (in order of preference):Django (more below)Turbogears (doesn't have the admin, not RESTful by default) RoR (python is

Re: Bulk delete - lets try this again...

2006-01-25 Thread Russell Keith-Magee
On 1/21/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > I've attached (but not committed) a patch for bulk delete in > magic-removal (Ticket #1219). Comments on this thread seem to have gone dead - are there any objections out there to me committing this patch (the newer patch with object d

Ajax again

2006-01-25 Thread Leonardo Santagada
I am asking this because I am choosing the tools for my next project. The frameworks I am looking at are (in order of preference): Django (more below) Turbogears (doesn't have the admin, not RESTful by default) RoR (python is a much cleaner language) Plone (I have downloaded plone twice at least

Re: magic-removal: "Change subclassing syntax"

2006-01-25 Thread Daniel Poelzleithner
Jeremy Dunck wrote: > This makes me think the world needs a wiki whose wikitext syntax is > restructured text. In general ? At least trac has a macro for restructured text I think. kindly regards daniel

Re: magic-removal: "Change subclassing syntax"

2006-01-25 Thread Jeremy Dunck
On 1/25/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 1/25/06, Jason Davies <[EMAIL PROTECTED]> wrote: > > I think that's the best we've got. Is it worth creating a wiki page? > > Yeah, let's collect the design decisions and code examples on a wiki page. This makes me think the world nee

Re: magic-removal: "Change subclassing syntax"

2006-01-25 Thread Adrian Holovaty
On 1/25/06, Jason Davies <[EMAIL PROTECTED]> wrote: > I think that's the best we've got. Is it worth creating a wiki page? Yeah, let's collect the design decisions and code examples on a wiki page. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: magic-removal: "Change subclassing syntax"

2006-01-25 Thread Jason Davies
Joseph Kocherhans wrote: > Is this a good summary of the current thinking on subclassing? > > http://groups.google.com/group/django-developers/browse_frm/thread/ea5e0bf903058fac/9a68ac0d99cb6d7d?q=semantics&rnum=1#9a68ac0d99cb6d7d > > The wiki doesn't say a whole lot about it, although it's proba

magic-removal: "Change subclassing syntax"

2006-01-25 Thread Joseph Kocherhans
Is this a good summary of the current thinking on subclassing? http://groups.google.com/group/django-developers/browse_frm/thread/ea5e0bf903058fac/9a68ac0d99cb6d7d?q=semantics&rnum=1#9a68ac0d99cb6d7d The wiki doesn't say a whole lot about it, although it's probably in someone's brain ;) Joseph

Re: broken tests after pluralization removal [2111]

2006-01-25 Thread Joseph Kocherhans
On 1/25/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > Place.objects.get_object(restaurants__place__exact=1) > > > > But with the removal of pluralization in [2111], these broke. Changing > > restaurants (pl) to restaurant (sg) fixes

Re: broken tests after pluralization removal [2111]

2006-01-25 Thread Adrian Holovaty
On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > Place.objects.get_object(restaurants__place__exact=1) > > But with the removal of pluralization in [2111], these broke. Changing > restaurants (pl) to restaurant (sg) fixes the problem. I imagine this > was an intended (or at least desired

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Luke Plant
... also, what happens about exceptions i.e. when do they get thrown? This applies to all the lazy collections, and also foreign key relationships: e.g. from the wiki: > article.reporter > article.reporter.id (Doesn't do a DB query) The first could throw Reporter.DoesNotExist, but the secon

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Luke Plant
On Wed, 25 Jan 2006 11:46:09 -0600 Adrian Holovaty wrote: > If managers behaved like that, how would one do the equivalent of > get_object()? ... and get_values() (which doesn't fit the 'sets' paradigm at all, since it can contain duplicates)? The original proposal was only for model instance a

broken tests after pluralization removal [2111]

2006-01-25 Thread Joseph Kocherhans
In a bunch of model tests there's code like: Place.objects.get_object(restaurants__place__exact=1) But with the removal of pluralization in [2111], these broke. Changing restaurants (pl) to restaurant (sg) fixes the problem. I imagine this was an intended (or at least desired) side effect. If so

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Joseph Kocherhans
On 1/25/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > If this were the case then it would be impossible to combine filter > > and order_by, at least in this way: > > > > MyModel.objects.filter(creator__exact=5) > > MyModel.objects.o

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Joseph Kocherhans
On 1/25/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > Is anyone planning on tackling the descriptor fields proposal anytime > > soon? If not, I can give it a shot. > > I was planning on starting this last night but got wrapped up in

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Adrian Holovaty
On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > If this were the case then it would be impossible to combine filter > and order_by, at least in this way: > > MyModel.objects.filter(creator__exact=5) > MyModel.objects.order_by('status') > for obj in MyModel.objects: > print obj > > F

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Joseph Kocherhans
On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > On 1/25/06, Jason Davies <[EMAIL PROTECTED]> wrote: > > > > > > Joseph Kocherhans wrote: > > > > > At any rate, Managers and ManyToMany/OneToMany attributes do extremely > > > similar things, and I think they could share an api and maybe e

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Adrian Holovaty
On 1/25/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > Is anyone planning on tackling the descriptor fields proposal anytime > soon? If not, I can give it a shot. I was planning on starting this last night but got wrapped up in other stuff. I'd like to start on it myself later this evening.

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Joseph Kocherhans
On 1/25/06, Jason Davies <[EMAIL PROTECTED]> wrote: > > > Joseph Kocherhans wrote: > > > At any rate, Managers and ManyToMany/OneToMany attributes do extremely > > similar things, and I think they could share an api and maybe even > > share most implementation. If managers behaved like object attr

Re: DescriptorFields status/Manager API change

2006-01-25 Thread Jason Davies
Joseph Kocherhans wrote: > At any rate, Managers and ManyToMany/OneToMany attributes do extremely > similar things, and I think they could share an api and maybe even > share most implementation. If managers behaved like object attributes, > this is what I'm worried about: > > MyModel.objects.fi

DescriptorFields status/Manager API change

2006-01-25 Thread Joseph Kocherhans
Is anyone planning on tackling the descriptor fields proposal anytime soon? If not, I can give it a shot. I'm not entirely clear as to how to do the ManyToMany and the auto-generated end of the ForeignKey fields yet. It really feels like they should just return a Manager instance (that automatica

content types and packages need reworking for magic-removal

2006-01-25 Thread Jason Davies
Hi, I was just fiddling around trying to get comments working in magic-removal when I came across this in django.contrib.contenttypes.models: def get_model_module(self): "Returns the Python model module for accessing this type of content." return __import__('django.models.%s.

Re: Tinymce

2006-01-25 Thread akaihola
Open the generated admin page in your browser. Take a look at the HTML source. Check that the paths in the