Re: attribute__isnull=True vs attribute__exact=None (Ticket 2737)

2006-10-11 Thread Russell Keith-Magee
On 10/12/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I agree the second two cases are bugs. I'm probably -0 on making > exact=None be the same as isnull=True, because it's a synonym for > something you can already do (we already have isnull). Still, I guess > it's a harmless change (which

Re: attribute__isnull=True vs attribute__exact=None (Ticket 2737)

2006-10-11 Thread Malcolm Tredinnick
On Thu, 2006-10-12 at 14:05 +1000, Matthew Flanagan wrote: > Hi Russ, > > Is http://code.djangoproject.com/ticket/2400 is related to this as well? I don't think so. #2400 is asking for bonus functionality (from an implementation perspective). It requires twisting the generated SQL slightly in or

Re: attribute__isnull=True vs attribute__exact=None (Ticket 2737)

2006-10-11 Thread Malcolm Tredinnick
On Thu, 2006-10-12 at 11:43 +0800, Russell Keith-Magee wrote: [...] > Also, fixing this problem is problematic because it encroaches upon > Malcolm's refactor of the QuerySet code. > > Comments? Have I missed an obvious problem? Have I missed a ticket in > the database that describes this problem

Re: attribute__isnull=True vs attribute__exact=None (Ticket 2737)

2006-10-11 Thread Matthew Flanagan
Hi Russ, Is http://code.djangoproject.com/ticket/2400 is related to this as well? On 12/10/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > Hi All, > > I've hit upon an interesting bug, which is related to ticket 2737 > (currently listed as a feature request, but I think there is an > argu

attribute__isnull=True vs attribute__exact=None (Ticket 2737)

2006-10-11 Thread Russell Keith-Magee
Hi All, I've hit upon an interesting bug, which is related to ticket 2737 (currently listed as a feature request, but I think there is an argument that the requested feature is required as a bug fix). Consider the following model: class Poll(models.Model): name = models.CharField(maxlength=1

Re: 答复: Make django run on top of twisted

2006-10-11 Thread Nick Cen
ok. I have open a new ticket with number 2904 2006/10/12, Eugene Lazutkin <[EMAIL PROTECTED]>: > > cenyongh wrote: > > My method is based on this. And I add defer support which I think it is > > the most important reason for why we integrate these two frameworks. > > Could you add your version to

Re: 答复: Make django run on top of twisted

2006-10-11 Thread Eugene Lazutkin
cenyongh wrote: > My method is based on this. And I add defer support which I think it is > the most important reason for why we integrate these two frameworks. Could you add your version to the Trac ticket #172 and reopen it as an enhancement? Another way to do it is to open a new enhancement ti

Re: 答复: Make django run on top of twisted

2006-10-11 Thread Eugene Lazutkin
cenyongh wrote: > My method is based on this. And I add defer support which I think it is > the most important reason for why we integrate these two frameworks. Could you add your version to the Trac ticket #172 and reopen it as an enhancement? Another way to do it is to open a new enhancement ti

答复: Make django run on top of twisted

2006-10-11 Thread cenyongh
 My method is based on this. And I add defer support which I think it is the most important reason for why we integrate these two frameworks. 发件人: django-developers@googlegroups.com [mailto:[EMAIL PROTECTED] 代表 Rafael SDM Sierra发送时间: 2006年10月12日 0:10收件人: django-developers@googlegroups.com

Re: Make django run on top of twisted

2006-10-11 Thread Rafael SDM Sierra
I'm looking for this a few days ago and found it: http://code.djangoproject.com/ticket/172On 10/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Someone has submit a method before.He use twsited WSGIResource to wrapthe django'WSGIHandler .But this method can not support Defer. Thewhole structur

Re: New filter proposal: None -> Blank Space

2006-10-11 Thread Mario Gonzalez ( mario__ )
On 11/10/06, Mario Gonzalez ( mario__ ) <[EMAIL PROTECTED]> wrote: > On 11/10/06, Don Arbow <[EMAIL PROTECTED]> wrote: > > > > There's already a filter called 'default_if_none', check the > > documentation. > > > yeah, I saw it before I sent this email :( sorry if I disturbed well, I saw

Re: New filter proposal: None -> Blank Space

2006-10-11 Thread Mario Gonzalez ( mario__ )
On 11/10/06, Don Arbow <[EMAIL PROTECTED]> wrote: > > There's already a filter called 'default_if_none', check the > documentation. > yeah, I saw it before I sent this email :( sorry if I disturbed anyone. I did it like: #in a template: {{ foo|default_if_none:"" }} Thanks! > Don >

Re: New filter proposal: None -> Blank Space

2006-10-11 Thread Don Arbow
On Oct 11, 2006, at 8:11 AM, Mario Gonzalez ( mario__ ) wrote: > > Hello! I think we've been talking in irc, my nick is mario__ and now > I really like to help to django code, if you let me. Sometimes sql > queries returns NULL values and python change that with a None type, > then I cannot sho

New filter proposal: None -> Blank Space

2006-10-11 Thread Mario Gonzalez ( mario__ )
Hello! I think we've been talking in irc, my nick is mario__ and now I really like to help to django code, if you let me. Sometimes sql queries returns NULL values and python change that with a None type, then I cannot show a None in a web page so, I have to change that like: #in a view if fo

Re: Re: Why doesn't models.Manager implement __iter__?

2006-10-11 Thread Joseph Kocherhans
On 10/11/06, Gábor Farkas <[EMAIL PROTECTED]> wrote: > > (i'm not sure i understand what you mean by "iterator protocol") The "iterator protocol" basically refers to __iter__() and next(). Its the stuff that python calls behind the scenes when you iterate over something. http://docs.python.org/l

Make django run on top of twisted

2006-10-11 Thread [EMAIL PROTECTED]
Someone has submit a method before.He use twsited WSGIResource to wrap the django'WSGIHandler .But this method can not support Defer. The whole structure of this method is similiar to these diagram: (Twisted)(Django) WSGIResource | \/ WSGIHandler

Re: list_filters does not work for models with one-to-one relationship, why?

2006-10-11 Thread Daniel Roseman
Honza Král wrote: > Hi all, > in django.contrib.admin.ChangeList.get_filters > there is a line: > > if self.lookup_opts.admin.list_filter and not > self.opts.one_to_one_field: > > does anybody know why there is the second part of the condition? > when I commented the second part out, the

Re: greater_than and less_than template filters

2006-10-11 Thread Le Roux Bodenstein
Hmm. Just realised that truncatewords already adds the ... at the end.. Anyway, I wrote some filters (not tested extensively): from django.template import Library def gt(value, arg): "Returns a boolean of whether the value is greater than the argument" return value > int(arg) def lt(va

Re: Why doesn't models.Manager implement __iter__?

2006-10-11 Thread Gábor Farkas
Russell Keith-Magee wrote: > On 10/11/06, Gábor Farkas <[EMAIL PROTECTED]> wrote: >> Russell Keith-Magee wrote: > >> sorry, but is this the description of the __iter__ case, or the >> iterator() case? > > Now that you mention it (looks furiously at code...) > > Ok - it doesn't work quite li

greater_than and less_than template filters

2006-10-11 Thread Le Roux Bodenstein
Hi I often want to check if the length of things inside templates are more than something. For example.. I want to display the first 10 words of a comment inside a listing. I can do {{comment.body|striptags|truncatewords:10}} but if the amount of words are more than 10, I want to display ... afte

Re: Why doesn't models.Manager implement __iter__?

2006-10-11 Thread Russell Keith-Magee
On 10/11/06, Gábor Farkas <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > sorry, but is this the description of the __iter__ case, or the > iterator() case? Now that you mention it (looks furiously at code...) Ok - it doesn't work quite like I thought it did. Here's the rundown

Re: Why doesn't models.Manager implement __iter__?

2006-10-11 Thread Gábor Farkas
Russell Keith-Magee wrote: > >> somehow i assumed that the QuerySets never load in the whole result-set, >> except when they are forced (cast to list for example). but now i see >> that of course, if you cache the results, then you will have all the >> results in memory anyway... > > This is wha

Re: Proposal: .sum() .max() etc methods to a queryset

2006-10-11 Thread Russell Keith-Magee
On 10/11/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > I think, you should be able to do that with the method extra() at the moment: > http://www.djangoproject.com/documentation/db_api/#extra-select-none-where-none-params-none-tables-none > > Anyway I am +1 for this proposal, as it would ma

Re: Why doesn't models.Manager implement __iter__?

2006-10-11 Thread Russell Keith-Magee
On 10/11/06, Gábor Farkas <[EMAIL PROTECTED]> wrote: > > Michael Radziej wrote: > hmm.. maybe i am only implementing strange web-applications, but up to > now, i never ever needed the caching behaviour of the QuerySets...so i > probably will have to ALWAYS use the iterator() method. > > > (just fo

Re: Proposal: .sum() .max() etc methods to a queryset

2006-10-11 Thread Aidas Bendoraitis
I think, you should be able to do that with the method extra() at the moment: http://www.djangoproject.com/documentation/db_api/#extra-select-none-where-none-params-none-tables-none Anyway I am +1 for this proposal, as it would make things easier and faster. Regards, Aidas Bendoraitis [aka Archa