2009-7-17

22:39 Ox-
yeah probably, i just assumed he was using that for quick example though
22:39 Ox-
for one thing, why bother putting static strings inside {{}} :)
22:40 enjalot
is there a standard way to do breadcrumbs in django?
22:40 Ox-
no
22:41 SmileyChris
22:41 SmileyChris
that's why
22:41 Ox-
enjalot: you might want to check out django-navbar project though, it has bread crumb as part of its function
22:42 enjalot
Ox-: thanks ill check it out
22:42 Ox-
SmileyChris: well there ya go :)
23:18 pavera
I'm just testing out iPhone irc clients don't mind me
23:18 JDigital
We're on an iphone? Whee
23:19 pavera
is the channel just slow right now?
23:19 JDigital
must be
23:19 pavera
well everyone out drinking on a Friday night I guess
23:22 seanbrant
have question about arrays in query string, if i send object[]=1&object[]=2&object[]=3
23:22 seanbrant
i get back in my view object[] as the key and the value is 3
23:23 seanbrant
is there way to have it the way php does it, automatically parse the string into a array
23:23 seanbrant
so i can get [1, 2, 3] for key "object"
23:24 jcreigh
seanbrant: you'd do request.GET.getlist("object") (or request.POST as the case may be)
23:24 clayt
seanbrant what are you trying to do?
23:24 jcreigh
seanbrant: note that you do not need to put [] on the field name. (unless you want to.)
23:24 seanbrant
im doing a table sort with jquery and the data that gets posted is a serialized query string
23:27 seanbrant
getlist works but only if i do request.POST[.getlist('object[]')
23:27 seanbrant
that is okay though
23:27 clayt
so something like filter(bla__in=request.GET.get('object', []))
23:27 davidcramer_
that is some funny looking code :)
23:27 davidcramer_
request.get.getlist('object')
23:30 seanbrant
maybe ill just return a json string from javascript, that way i have better control of the correct ordering
23:33 subsume
Is there a way to make a model charfield's choices based on the model's instance?
23:33 subsume
Is there a way to make a model charfield's choices based on the model's instance?
23:33 subsume
In a form its easy... just override __init__
23:33 andym
subsume: you mean like setting the queryset in the form __init__
23:34 subsume
a bit, yes
23:34 andym
oh at the model level not the form?
23:34 subsume
heh.
23:34 subsume
yeah, i want it to work in /admin/ and on my site
23:34 subsume
i could add it to the form on my site....
23:34 andym
i have done that, but you can just do an admin form
23:35 subsume
yeah, then i have two forms
23:35 andym wonders where the hell that code was
23:35 subsume
its ok i think i just had an epifany.
23:40 andym waves
23:44 Guest60177
Is the tutorial located here: http://docs.djangoproject.com/en/dev/ up to date?
23:44 yakub
yes ..
23:44 Guest60177
I remember it was old so tehy must have updated it
23:46 yakub
hey anybody here?
23:46 yakub
I have a que
23:47 asdfqwer
I'm having some trouble getting the tagging add_on working with django
23:47 asdfqwer
23:47 asdfqwer
23:48 asdfqwer
I can import tagging from python
23:49 subsume
Hmm
23:49 asdfqwer
INSTALLED_APPS is basically an import, correct?
23:49 subsume
yes
23:50 subsume
well
23:50 subsume
hmm
23:50 subsume
no
23:50 subsume
=)
23:50 asdfqwer
one thing to note, is that I used python setup.py install to install tagging
23:51 yakub
I believe you need to upgrade the tagging app. Get that from its svn..
23:52 seanbrant
next question
23:52 subsume
sounds like it
23:52 yakub
hey i have a question
23:53 tomlikestorock
is there a way to have the model comma separated field be treated as an array? Or is there a built in field that does so already with non-normalized data?
23:53 yakub
members.get_object(slug__exact=slug, sites__id__exact=SITE_ID)
23:54 seanbrant
id like to do this queryset.filter(id__in=[1, 2, 3]).update(order=[4, 3, 5])
23:54 seanbrant
is that possible?
23:54 seanbrant
or do i have to update each record in a loop?
23:54 lawgoff
what does it do?
23:55 seanbrant
i have a list of ids and the new order for each id, i want to update all the objects at once
23:55 seanbrant
its for table sorting
23:55 subsume
order for each id...?
23:55 subsume
oh
23:55 subsume
like cardinality or wtvr
23:55 lawgoff
use a loop
23:56 subsume
yes, a loop is the only way.
23:56 seanbrant
cool, thanks
23:56 subsume
well, raw sql could do it in one query
23:56 lawgoff
of course it is one extra line of code
23:56 seanbrant
yeah, i might look into raw sql if the performance is crap
23:57 seanbrant
would calling update on the query set be better than fetching the object modifying and then saving?
Page 25 of 25   ← Previous  (2,481 total)