On 12/25/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
I'll have to dig through django source, but I'm pretty sure I've seen
sentinels implemented with the "oh, this string'll never be valid
input" strategy. I'll make a patch for those.
Apparently my comment was grievous slander. I didn't find
On 12/25/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
Jeremy Dunck wrote:
> NOT_GIVEN="(*piuhuI&*uyobJH!ikuoi1p9e;mks c0p[p"
>
> def reduce_(f,s,i=NOT_GIVEN):
>it=iter(s)
>if i == NOT_GIVEN:
hmm. if you post code like that often enough, we may have to revoke
your python coder's licen
Jeremy Dunck wrote:
NOT_GIVEN="(*piuhuI&*uyobJH!ikuoi1p9e;mks c0p[p"
def reduce_(f,s,i=NOT_GIVEN):
it=iter(s)
if i == NOT_GIVEN:
hmm. if you post code like that often enough, we may have to revoke
your python coder's license ;-)
:::
for the archives, here's the "right" way to do i
On 12/23/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
...
Same result, different composition. Personally, given Guido's
predisposition to eliminating reduce() in Python 3000 [1], I'd be
avoiding using reduce in new code.
A python implementation of reduce:
NOT_GIVEN="(*piuhuI&*uyobJH!ik
Don Arbow wrote:
Python 2.5 has any() and all() to replace reduce(). So I believe you
could do this:
list = Model.objects.filter(any([Q(name__startswith=letter) for letter
in 'abc']))
the goal here isn't to check if any of the Q's are true, it's to join
together all the Q's with the "bi
On Dec 22, 2006, at 10:21 PM, Russell Keith-Magee wrote:
Same result, different composition. Personally, given Guido's
predisposition to eliminating reduce() in Python 3000 [1], I'd be
avoiding using reduce in new code.
Python 2.5 has any() and all() to replace reduce(). So I believe you
co
On 23-Dec-06, at 11:51 AM, Russell Keith-Magee wrote:
> Use Q objects to OR three queries together.
>
> Model.objects.filter(Q(name__startswith='a') | Q
(name_startswith='b')
> | Q(name_startswith='c'))
got this from #django:
list=Model.objects.filter(reduce(operator.or_,[Q
(name__startwit
On 12/23/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
On 23-Dec-06, at 9:48 AM, Russell Keith-Magee wrote:
> Use Q objects to OR three queries together.
>
> Model.objects.filter(Q(name__startswith='a') | Q(name_startswith='b')
> | Q(name_startswith='c'))
got this from #django:
list=Model
On 23-Dec-06, at 9:48 AM, Russell Keith-Magee wrote:
Use Q objects to OR three queries together.
Model.objects.filter(Q(name__startswith='a') | Q(name_startswith='b')
| Q(name_startswith='c'))
got this from #django:
list=Model.objects.filter(reduce(operator.or_,[Q
(name__startwith=letter)
On 12/23/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
hi
whats the best way of retrieving names that start with either 'a',
'b' or 'c'. I need something like:
Model.objects.filter(name__startswith__range('a','c')
Use Q objects to OR three queries together.
Model.objects.filter(Q(name__
hi
whats the best way of retrieving names that start with either 'a',
'b' or 'c'. I need something like:
Model.objects.filter(name__startswith__range('a','c')
--
regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
--~--~-~--~~~---~--~~
11 matches
Mail list logo