2008-3-14

22:53 Magus-
use a pastebin
22:53 Xorelock
pastebin.ca pastebin.com etc
22:53 urugan
ok, good that i asked:O
22:54 malibu
Magnus, I have two systems that I develop on.. is it possible to use settings.py to define absolute paths inside url.py?
22:54 malibu
(I just want to change one file)
22:54 urugan
22:54 urugan
this is the custom_filters.py, if anyone could take a look
22:54 wolfe
(just now) User: "where did all my music go?" Me:"I made your profile smaller, now it wont take so long to load over the network. Thanks, BOFH" (her profile was 5GB)
22:55 wolfe
I should just set quotas on everyone's profile folder, heh.
22:56 Xorelock
wolfe: create a daemon that scans for media files and nukes them? whitelist people with legit reasons for having media on their accounts
22:56 Xorelock
s/daemon/cron job/;
22:56 wolfe
Xorelock: I'm thinking about it
22:56 wolfe
we're not supposed to have music on the network anyway
22:56 wolfe
thats what CDs and mp3 players are for
22:57 Xorelock
tell them to store their music on portable externals or thumb drives if they really need to play it out their computer speakers
22:58 illustir
why aren't queries from connection.queries pasteable?
22:59 tie
malibu: check the following blogpost http://gnuvince.wordpress.com/2007/12/22/django...
23:01 mattmcc
The author of that blog seems to have never heard of reverse URL lookups.
23:01 mattmcc
Oh, wait, he does mention it. Then I'm just confused why he's working so hard not to use it.
23:01 urugan
ok, it seems that my little stupid problem is that it doesn't load this file at all
23:02 mattmcc
urugan: Can you import it from a python shell?
23:02 Magus-
urugan: did you put it all in the right place?
23:02 Magus-
is the app its part of in INSTALLED_APPS ?
23:02 Magus-
did you restart the server?
23:02 tie
mattmcc: this may be the case :) setting a dynamic project path in settings is a good one hough
23:02 Magus-
did you use {% load %} ?
23:04 urugan
in settings.py i have my app mentioned in installedapps. in my template i'm using {% load custom_filters %}. i didn't restarted (dev server)
23:04 urugan
templatetags dir has __init__.py and is inside app folder
23:06 urugan
ok, i've restarted
23:06 urugan
thanks, sorry for being such a baby.
23:06 malibu
tie, thanks for the blog post! Looks good; will have to absorb later
23:07 Xorelock
interesting. i've been developing something similar to that myself, actually
23:07 Xorelock
(re: the blog post)
23:08 joshhunt
So im doing this tutorial http://www.djangoproject.com/documentation/tuto... . Now im up to the 'Let�s add a custom method, just for demonstration' part near the end. Now, when do i put that code...? Its a bit confusing
23:09 salkot
joshhunt, that's in models.py
23:09 salkot
you're adding a custom method to the Poll model
23:10 Xorelock
i've actually written half an api that sits on top of django handling a tonne of minor annoyances (granular permissions, exportable app-level settings, automatic global and app-level context augmentation, etc...)
23:11 joshhunt
oh ok, so i would add 'import datetime' at the top, and 'def was_published_today(self)' after the unicode part in the Poll class bit?
23:12 salkot
that's right
23:12 joshhunt
:) thanks
23:12 salkot
np
23:16 jlivni
hey, i have a question about how best to set up my urls for situations when i want to return some subset of data on a filter
23:16 jlivni
for example, if i have a manytomany relationship, and i want to show all results for X where Y could equal (a,b,c, or d) .. i wonder what the url for that should be
23:17 jlivni
/site/xobject?y=a,b,c,d ... or is there a better way?
23:17 jlivni
and given my filters could get quite long, do people sometimes do this with a POST instead ?
23:17 salkot
jlivni, that looks like the best way
23:17 salkot
although it might be more typical of django style to have a / after xobject
23:18 jlivni
but really i want to GET my data, not POST anything new, but i also don't want to run over 2k characters in my filter
23:18 salkot
2k???
23:18 jlivni
ah - right /xobject/filterfield=abcd .. good point
23:18 jlivni
well, after 2k characters in a url IE stops reading
23:18 spankalee
is there a way to control the ordering of fields with ModelForm?
23:18 jlivni
its unlikely but possible someone might select enough filter options to go over that amt.
23:19 spankalee
i explicitly set my fields in Meta: but the order isn't correct
23:19 salkot
spankalee, the ordering in Meta isn't for the ordering of fields, but for ordering of sets
23:20 spankalee
salkot: huh?
23:20 salkot
jlivni, if you want to handle that case you might have to do a post, or make some kind of server-side token that represents the search
23:20 salkot
spankalee, are you talking about using "ordering" in Meta?
23:21 spankalee
no
23:21 spankalee
Meta.fields
23:21 jlivni
ah, maybe a session variable that stores the current search. i think i prefer that to POSTing when I'm actually making a fetch request. thx for that idea
23:21 spankalee
I set Meta.fields = ('field1', etc...) and the ordering is mostly correct, but one many-to-many field keeps showing up last
23:22 salkot
spankalee, Admin.fields?
23:22 spankalee
no
23:22 spankalee
not using admin
23:22 Magus-
spankalee: defined last in model?
23:22 spankalee
no
23:22 spankalee
my Meta.fields list actually matches the model def. I'm just trying to get that ordering to show up
23:23 spankalee
it's only this one m2m field. possible bug?
23:23 odinsbane
a five day work shop for learning django 3500 dollars !?
23:23 salkot
sweet, where can I sign up to teach? ;o
23:23 spankalee
i'll check trac
23:23 spankalee
$3500!!
23:23 Xorelock
is it in the works to set dispatcher hooks on m2m additions/deletions ?
23:24 Magus-
Xorelock: you'd have to go look for a ticket for that
23:28 spankalee
hmm... #6369 is about explicit field ordering, and it's accepted. does that mean it's included in the latest SVN?
23:28 DjangoBot
23:29 mattmcc
No, it means it's accepted.
23:29 Magus-
fixed would mean it was there, of course
23:29 Magus-
accepted just means "yah ok, this seems valid"
23:29 spankalee
ok
23:34 salkot
I thought you were talking about models, not forms, oops
23:38 dcramer[]
hey Magus- :D
23:39 dcramer[]
how do I get the document height? :)
23:39 illustir
I have Q() fields behaving radically different on my server than on my local machine, any possible causes?
23:39 Magus-
23:39 Magus-
er, wait, doc height or window height?
23:40 dcramer[]
a mix of both, i need minimum of window
23:40 dcramer[]
max of doc
23:40 dcramer[]
-.-
23:40 Magus-
the .scrollTop and .scrollHeight will give you values including scrollable
23:40 Magus-
.scrollTop = how far down you're scrolled, .scrollHeight = total possible height
23:40 Magus-
though safari has issues with some of that on textareas
23:41 salkot
illustir, same versions of django?
23:41 urugan
i would ask you to advice me on that: i want to have the ability to choose one clientcompany name from larger list, but i want to allow the user to choose it without leaving the current page. first i thought about simply populating the dropdown, but now i know there's going to be quite a lot of these records. So, does anyone have any idea how to solve that? Some ajax webservice-autocomplete-clientname-textbox or maybe some modalpanel
23:41 illustir
salkot, i hope so, how do i find out?
23:42 mattmcc
urugan: There are lots of ajax autocomplete options out there.
23:42 salkot
urugan, scriptaculous has an ajax autocompleter
23:42 salkot
illustir, django.get_version()
23:42 dcramer[]
hrm i did this magus: Math.max(document.documentElement.clientHeight, document.body.clientHeight) + 'px';
Page 24 of 25   ← Previous  Next →(2,430 total)