limit_choices_to - allow FunctionType values?

2006-07-26 Thread michael
I'm new to Django, so forgive me if this idea walks all over the thus far tidy architecture. I was wondering if db/models/query.py could check for the type of the value in the parse_lookup() kwarg,value pairs. If a value's type is FunctionType, the function could be invoked. This would allow mo

Re: A proposal for URL generation

2006-07-26 Thread Ahmad Alhashemi
Great to hear that Adrian. Nevermind my post then :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe

Re: A proposal for URL generation

2006-07-26 Thread Adrian Holovaty
On 7/26/06, Ahmad Alhashemi <[EMAIL PROTECTED]> wrote: > This is a well know problem. You can read about it in the background > section below. The ticket for this problem have been sitting unresolved > for a long time now. I would really like to get some feedback from the > developers. If you like

Re: Reversed urlresolvers and included urlconfs

2006-07-26 Thread Ahmad Alhashemi
This is a know issue waiting for a solution that will satisfy the developers. I've just posted a proposed solution here in the developers list. You can also check the ticket which was opened nine months ago and is still unresolved: http://code.djangoproject.com/ticket/672 --~--~-~--~

A proposal for URL generation

2006-07-26 Thread Ahmad Alhashemi
This is a well know problem. You can read about it in the background section below. The ticket for this problem have been sitting unresolved for a long time now. I would really like to get some feedback from the developers. If you like this, I will submit a patch with the implemenation. My soluti

Re: Re: Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread monkeynut
Yep, that's me. There'll be some funkiness because they both work out the next/previous month/day in different ways, with this later patch using the current next/previous system.. but it shouldn't be too difficult to combine them into one super-patch : ) Pete.On 7/26/06, Tyson Tate <[EMAIL PROTECTE

Re: Re: Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Tyson Tate
On 7/26/06, monkeynut <[EMAIL PROTECTED]> wrote: > http://code.djangoproject.com/ticket/2433 > .. hopefully I didn't miss anything, I've been out in the sun all day. > > Pete. Not sure if you're the same Pete, but hopefully that patch can work well with this one: http://code.djangoproject.com/tic

Re: Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread monkeynut
http://code.djangoproject.com/ticket/2433.. hopefully I didn't miss anything, I've been out in the sun all day.Pete. On 7/26/06, Jay Parlar <[EMAIL PROTECTED]> wrote: On 7/26/06, Tyson Tate <[EMAIL PROTECTED]> wrote:> I'm +50 on this because I'm about ready to jump in to a large calendar> project n

Re: Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Jay Parlar
On 7/26/06, Tyson Tate <[EMAIL PROTECTED]> wrote: > I'm +50 on this because I'm about ready to jump in to a large calendar > project next week and I'll need this functionality. If no one beats me > to it, I'll try to remember to hammer out a patch next week. > > Any suggestions for how people wou

Re: Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Pete Crosier
I was reading this post, then realised I needed to do this.. I've put together a patch that uses the allow_future idea. Should I make a new ticket and attach it for criticism? : )Pete. On 7/26/06, Tyson Tate <[EMAIL PROTECTED]> wrote: On 7/26/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:> It'll

Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Ian Holsman
i would add a flag to the views parameters.that way existing code which relies on the future stuff not being viewable won't be broken.you should also have a look at the history_view view I wrote (http://svn.zyons.python-hosting.com/trunk/zilbo/common/utils/views/filter.py)which does date-based view

Re: Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Tyson Tate
On 7/26/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > It'll get fixed one day, since it's useful functionality. Somebody can > submit a patch or I'll write it one day (low priority). It's really just > waiting on a patch that has reasonable API. > > Regards, > Malcolm I'm +50 on this becaus

Re: after save() hook not called in admin?

2006-07-26 Thread Ivan Sagalaev
James Bennett wrote: > While we're on the topic, the docs explicitly advise against doing > 'len' on a QuerySet because of the potential memory overhead of > loading all the objects, and recommend using the QuerySet's 'count' > method instead. Would it make more sense, then, to internally change >

Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Malcolm Tredinnick
On Wed, 2006-07-26 at 09:23 -0400, Jay Parlar wrote: [...] > Adrian's justification was that the system was built for "archival" > purposes. I brought this up earlier in Django-users, > http://groups.google.com/group/django-users/browse_thread/thread/5b5d4fa5ad40f7bf/95de22e1e42b5d21 > > A thread

Re: after save() hook not called in admin?

2006-07-26 Thread James Bennett
On 7/26/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Assign it to me. I have the code written that just about makes this work > already. So it will be a good reminder to finish it off. Done (#2430). While we're on the topic, the docs explicitly advise against doing 'len' on a QuerySet bec

Re: after save() hook not called in admin?

2006-07-26 Thread Malcolm Tredinnick
On Tue, 2006-07-25 at 16:36 -0500, James Bennett wrote: [...] > Ideally, just doing any sort of boolean test on a QuerySet would force > it to evaluate; adding a __nonzero__ method to QuerySet would > accomplish that, and the docs on when QuerySets are evaluated could be > changed to reflect it. >

Re: Model inheritance API

2006-07-26 Thread Ahmad Alhashemi
A few corrections... > 2. I'm not sure weather multiple inheritance will be a feasible > solution in Python (because the code that is going to introspect the > Thing super class and add its fields to our class is model.Model, which > is one of the suer classes). It is actually feasible, I just c

Re: after save() hook not called in admin?

2006-07-26 Thread wnielson
if I call save() on an object in the shell, it works perfectly; --exactly as it should--. I will do some more digging today and try to find out more. btw, it looks like admin is using the model's default AddManipulator. Would the fact that it is calling the AddManipulator instead of directly cal

Re: Model inheritance API

2006-07-26 Thread Ahmad Alhashemi
Malcolm Tredinnick wrote: > --- > 1. Abstract Base class > --- > One use-case for subclassing is to use the base class as a place to > store common fields and functionality. It is purely a "factor out the > common stuff" holder and you don't ever intend to u

Reversed urlresolvers and included urlconfs

2006-07-26 Thread Joeboy
Hi I've just been looking at the reverse url lookup stuff in django.core.urlresolvers, and I can't see any way of working out what regex is causing a set of urls to be included. Should this functionality be included? Am I stupid (probably)? My use case is that I have a decoupled app whose urls a

Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Ian Holsman
On 26/07/2006, at 11:23 PM, Jay Parlar wrote: Adrian's justification was that the system was built for "archival"purposes. I brought this up earlier in Django-users,http://groups.google.com/group/django-users/browse_thread/thread/5b5d4fa5ad40f7bf/95de22e1e42b5d21A thread you seem to have participat

Re: why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Jay Parlar
On 7/26/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > Hi. > > I was wondering what the rationale is behind having the date-based generic > views only show 'historical' events. > they all seem to have > # Only bother to check current date if the date isn't in the past. > if date >= now.dat

why are the date-based views restricted to only displaying past-events?

2006-07-26 Thread Ian Holsman
Hi.I was wondering what the rationale is behind having the date-based generic views only show 'historical' events.they all seem to have    # Only bother to check current date if the date isn't in the past.    if date >= now.date():        lookup_kwargs['%s__lte' % date_field] = nowyes I know I can

Re: after save() hook not called in admin?

2006-07-26 Thread Michael Radziej
wnielson wrote: > Still no go though. Even after removing the if not > self.genres.all().count(), it is still not updating the ManyToMany. I cannot believe this has got anything to do with the super call. This is related to the many-to-many-relationship. I suggest that you just try to add a genr