2009-7-14

23:07 subsume
hense: the horrors of democracy
23:08 hense
fualo: a forloop would handle that exception for you correctly
23:08 fualo
hense: I'm not using an iterator at all - the exception is from manager.py
23:08 rozwell
hense: normally by whatever management position is responsible (i.e. top down)
23:08 fualo
models.Event.objects.extra(select={'relevance': match_expr}, where=[match_expr], params=[query, query])
23:08 fualo
it's within django
23:08 hense
fualo: doesn't change my answer.
23:09 fualo
23:09 subsume
fualo: [where_expr] ? is that right?
23:10 fualo
subsume: where?
23:10 subsume
err
23:10 subsume
match_expr
23:10 subsume
where are you getting this code from?
23:10 fualo
should be right... is there a way to see the query extra created?
23:11 fualo
subsume: its a heavily changed version of this http://www.mercurytide.co.uk/news/article/djang...
23:11 subsume
oh lord. that thing.
23:11 fualo
which doesn't work
23:11 subsume
haven't seen that in like a year.
23:11 fualo
yea.
23:11 fualo
it's bad.
23:12 hylje
terriblebad
23:13 fualo
hopefully I can produce a better version, which can be shared
23:13 rozwell
fualo: throw it on the stack there next to the 1000 other fulltext search apps
23:13 asorbus
Can I use generic views to abstract RSS feeds? Like, if I want to have 10 feeds that are very similar, I don't have to write 10 different classes for each one, right?
23:14 fualo
rozwell: :-)
23:14 fualo
rozwell: well maybe you can suggest a favorite?
23:14 sayane_
asorbus, yes, you're right
23:14 sayane_
just write generic RSS Feed class ;-)
23:14 chrishartim
hi.. is there a way to make Django force a www. subdomain?
23:15 asorbus
sayane_: all right, cool, so I'll just read up on generic views :) thanks
23:15 rozwell
asorbus: are you not using the syndication contrib app?
23:15 sayane_
chrishartim, there are many ways to do it. Best is to write custom middleware
23:16 asorbus
rozwell: I haven't really done any research yet, just wanted to see if it was possible before I started reading a bunch of stuff
23:16 fualo
either way, Im still curious why manager.py is throwing a stopiteration exception
23:16 asorbus
rozwell: so I'm not sure what you mean
23:16 rozwell
23:16 sayane_
asorbus, there is a framework for rss feeds
23:16 sayane_
and atom ;p
23:16 rozwell
23:16 asorbus
yeah, i'm reading that, but it seems like it wants a different class for every feed
23:17 asorbus
or maybe I just haven't read enough of it
23:17 rozwell
asorbus: you can subclass
23:18 asorbus
rozwell: I'm not sure what you mean by that, sorry :(
23:18 rozwell
asorbus: so you end up with several class definitions which are around 2 lines long. it's not really a problem
23:18 rozwell
asorbus: well continue reading and then ask pointed questions if you have any
23:18 asorbus
rozwell: okay, but then the URLconf will be really cluttered with stuff, won't it?
23:18 rozwell
asorbus: no, not necessarily
23:19 EyePulp
asorbus: I think the feed docs detail how to make more complex feeds to avoid that issue
23:19 asorbus
rozwell: if I subclass, won't the feed_dict need to have a key-value pair for every subclass?
23:19 rozwell
asorbus: like i said, continue reading, play with it, then if you still have questions ask them here
23:19 asorbus
EyePulp: rozwell: cool, I'll continue reading
23:20 fualo
so there is no way to see what SQL objects.extra turns out?
23:20 rozwell
fualo: yes there's a way to see it
23:20 rozwell
fualo: there's the method described in the faq as well as QuerySet.query.as_sql
23:21 fualo
didn't see that on the QuerySet API reference in docs, I'll check those places
23:21 rozwell
fualo: it's not documented
23:21 rozwell
fualo: it's part of the internals you shouldn't be messing with unless you know what you're doing
23:22 rozwell
fualo: anyway, look at the FAQ
23:23 JoaoJoao
howdy
23:23 FunkyBob
o/
23:25 idangazit
hey, has anybody ever used random.sample on a queryset before?
23:26 idangazit
rather, a large queryset?
23:26 idangazit
curious if it makes the pony cry
23:26 rozwell
idangazit: i'm not sure why you would
23:26 idangazit
I guess I could do order_by('?')[:5} or whatever
23:26 idangazit
yeah feeling stupid at 2:30 am
23:27 idangazit
nevermind
23:27 chrishartim
rozwell: thanks
23:56 holdenweb
Is there a common cause of off-by-one errors in get_FOO_type() methods?
23:57 holdenweb
Sorry, get_FOO_display() methods
23:57 signpost
I'm using the object_list generic view, and it works fine if queryset is Model.objects.all(), but I don't get the object_list at all if I use Model.objects.order_by('column'). Is there a nuance here I'm missing?
23:58 holdenweb
Model.objects.all().order_by('column') ?
23:58 rozwell
Model.objects.order_by(...) is fine
23:59 rozwell
and equivalent to Model.objects.all().order_by(...)
23:59 rozwell
holdenweb: pastebin your models
23:59 signpost
holdenweb: rozwell: nah, doesn't work either way. PostgreSQL shows that the query's getting run with either all() or order_by
23:59 holdenweb
OK ...
Page 23 of 23   ← Previous  (2,277 total)