2008-3-7

22:28 [530]
not
22:28 innox
oh
22:28 innox
let me check this
22:33 innox
I am using the shell, and trying to generate the error. I get the same one, But I don`t know how to use the stacktrace to actually find the source of the problem
22:33 Magus-
the stacktrace is irrelevant
22:33 Magus-
it will not show you the problem
22:34 Magus-
the problem has already occurred by the time you're getting that error
22:34 innox
ok, so what should be the procedure to follow to track back that problem ?
22:34 Magus-
you need to fix the query that actually broke it
22:34 Magus-
in the shell, one bad query will break it until you reconnect to the db
22:35 innox
ads = Ad.objects.all()
22:35 innox
that`s the query ...
22:35 Magus-
wrong
22:35 Magus-
if that's the one SHOWING the error, its merely the one you're on right now
22:35 cromero
Magus-: i don't have MEDIA_URL in my templates, why could this be?
22:35 Magus-
a PREVIOUS query caused it
22:35 Magus-
EVERY query after that will error
22:35 Magus-
because you broke the transaction
22:35 Magus-
so it CANNOT be used
22:35 innox
ok ok, man is there a way to log in a file to debug �
22:35 innox
?
22:35 Magus-
cromero: you're not using RequestContext or you're not using the media context processor, or you're in 0.96 which didn't have it
22:35 Magus-
innox: no
22:36 innox
so what`s the best logging/debugging mechanism ?
22:36 cromero
Magus-: i'm in 0.96, how stable is the development version? is there something similar to media_url in 0.96? that variable exists in my settings
22:36 Magus-
you'd have to make your own context processor in 0.96 of course
22:37 Magus-
since it wasn't in trunk yet then
22:38 cromero
Magus-: i don't quite get it, so there's no straight forward solution to harcoding hrefs in the templates?
22:38 cromero
Magus-: in 0.96 that is
22:38 Magus-
>_<
22:38 Magus-
you're not listening at all
22:38 Magus-
MAKE YOUR OWN CONTEXT PROCESSOR
22:38 Magus-
so basically copying the one that is in trunk
22:38 Magus-
it simply did not exist yet in 0.96
22:38 Magus-
if you mean there's no BUILT IN SOLUTIOn
22:38 Magus-
then yes
22:39 Magus-
the media context processor did not exist in 0.96
22:39 Magus-
but the straightforward solution is to make your own two line processor
22:39 Magus-
and voila, problem solved
22:39 innox
well thx gusgus, it worked out well !
22:39 Emilian
but I don't want be a pirate!!
22:40 cromero
Magus-: then straightforward just became a relative term, since i have no idea hwo to make that teo line processor you mention
22:40 Magus-
try reading the docs I linked you to earlier
22:40 Magus-
22:40 Magus-
A context processor has a very simple interface: It���s just a Python function that takes one argument, an HttpRequest object, and returns a dictionary that gets added to the template context.
22:41 Magus-
def my_processor(request): return {"MEDIA_URL": settings.MEDIA_URL}
22:41 Magus-
ok ok, 3 lines
22:41 Magus-
since you need "from django.conf import settings" above that
22:41 Magus-
(as I wouldn't actually put the return on one line like that)
22:46 zbyszek
what is the "site" stuff for ?
22:46 enoj
zbyszek: it enables one django instance to control more than one domain
22:47 enoj
22:47 zbyszek
thnx
22:47 cromero
Magus-: my current settings has no TEMPLATE_CONTEXT_PROCESSORS variable, if i create sucha a variable there and point it to the 'my_processor' function, will it actually make sense?
22:48 Magus-
yes, but you need to redefine the defaults too
22:48 cromero
which means? whatever currently is in django.conf.settings.TEMPLATE_CONTEXT_PROCESSORS ?
22:49 cromero
or that doesn't make sense?
22:49 Magus-
22:49 Magus-
how about the ones clearly labelled in default :��
22:49 Brad___
I'm trying to add simple Free Comments to a app I'm writing. I want to add E-mail and URL fields so I have copied the contrib.comments app out and placed it in my project. I've added the fields but I can't for the life of me get them to show up in the database. I've dropped them from the database and re-synced but nothing still. Any ideas?
22:49 Magus-
Brad___: you can't do that
22:50 [530]
Brad___: fieldsets maybe?
22:50 Magus-
copying the code leaves it referencing contrib.comments
22:50 Magus-
[530]: no
22:50 [530]
Magus-: i agree it is a bad idea
22:50 Magus-
Brad___: you would have to edit every last reference to contrib.comments in the code of it also, so that it references yours instead
22:50 [530]
really bad idea
22:50 Magus-
[530]: its an idea that simply won't work...
22:50 Magus-
fieldsets have nothing whatsoever to do with this
22:51 Brad___
I knew I was forgetting something. I had done this before in the past I forgot about the references.
22:51 [530]
oh , copied out
22:51 Brad___
it should be a problem since I'm not editing the actually django.contrib.comments since I copied it out right?
22:51 Brad___
oh...yeah...cool
22:53 iggy
anyways to get fieldsets from forms? or do I hand code them?
22:53 [530]
iggy: hand code for the moment
22:53 iggy
for the moment sounds promising
23:06 iggy pats djangosnippets on the head
23:07 iggy
[530]: you think 6630 has a good chance of getting in? or some other ticket?
23:09 [530]
iggy: i have taken a look at that, needs some work, the patch currently does too much at once
23:13 dvschramm
23:13 empty
um, yeah
23:13 empty
google cache ftw
23:21 delamarche
Extremely stupid question here. Brace yourselves.
23:21 Magus-
42
23:21 empty
:D
23:21 delamarche
If I have an object with module scope in my views, (i.e. all view functions can access the same object), do I have to worry about synchronization?
23:21 Magus-
don't do that
23:21 delamarche
I find the answer to the question "do you need to sync this" in python is often no
23:21 delamarche
lol
23:21 delamarche
OK, I won't
23:21 delamarche
it felt icky anyways
23:22 Magus-
I would NOT trust globals to work like you want
23:22 delamarche
Thanks Magus-!
23:28 jamieo
Okay, I apologize in advance for a very dumb question that is tangential to Django - how do I drop down to the domain from url x/y/z in a link without having to use ../../../gohere
23:29 Magus-
/
23:29 Magus-
if you lead a url with a / it is relative to the domain root
23:29 delamarche
One-character answers are so awesome.
23:29 Magus-
so /foo/ always links to http://domain.com/foo/ no matter how deep you are
23:29 delamarche
The information-per-bit is beautiful
23:29 delamarche
especially in ascii
Page 24 of 25   ← Previous  Next →(2,417 total)