2008-3-3

23:15 Zalamander
visik7 personally, I think it's best to keep them separated, yes.
23:15 Zalamander
you can get RequestContext with render_to_response as well, but it's more convoluted
23:19 Emilian
tess, it is preference..but I am not sure if I understand..a plugin's size depends on what it is written, if it is compressed etc. not on JQuery itself. Regardless, it is a moot point.
23:21 tesseracter
Emilian, actually, i now remember the exact reason i dont use jQuery. the sortables serialize function. mootools is the only serializer that looks like [ "id", ["foo", "bar"], "baz"]. everyone else looks like [ "id_1", "bar_3", "foo_2", "baz_4"] and that is a pain.
23:23 pedjango
what's the proper way of ensuring certain URLs are always HTTPS?
23:23 tesseracter
i mean, whats with the numbers? i would have had to make my own serializer just to format my sortables. with mootools i just try them in as a list. no numbers. pretty silly reason, but oh well.
23:24 Emilian
whatever floats your boat
23:24 EyePulp
probably only of interest to myself, but it seems like you can feed strings as date values for object filtering. It seems to correctly convert to date vales for criteria (which SQL does internally anyway, but I couldn't figure out if django did too)
23:25 EyePulp
s/vales/values
23:26 Emilian
no more s/// D:
23:30 AzMoo
In the docs for modelforms it says: "The form field's label is set to the verbose_name of the model field, with the first character capitalized." but this doesn't work for the label attached to the errors. Is that a bug?
23:30 Emilian
aZmOO i LOOKED INTO IT
23:30 Emilian
IT IS BY DESIGN
23:30 Emilian
haha caps
23:30 AzMoo
!!
23:30 ubernostrum
AzMoo: error keys never use the verbose_name or the label.
23:30 Emilian
I was waiting for you to come online
23:30 Magus-
and no, that isn't a bug
23:30 AzMoo
By design? Why?
23:30 ubernostrum
Error keys always use the actual Python-level genuine name of the field.
23:30 Emilian
the key in the ErrorDict is the field name not the field.label
23:30 ubernostrum
AzMoo: well, what happens when someone translates your form class?
23:30 Magus-
one normally shows errors next to a field
23:31 ubernostrum
AzMoo: suddenly the key changes based on active language.
23:31 ubernostrum
Whoops.
23:31 Emilian
it could still pass the field.label though
23:31 Magus-
not to mention that keys like "some label with text" wouldn't be valid in templates :)
23:31 ubernostrum
Indeed.
23:31 Magus-
er, 'with spaces' should've been there
23:31 ubernostrum
So, for quite good reasons, the actual honest to goodness name of the field is used.
23:32 Emilian
right but you can still pass the field.label in the errors
23:32 Emilian
and keep the key as the field name
23:32 Emilian
and then just display the field.label
23:32 AzMoo
Emilian: That's what I was thinking
23:32 AzMoo
damn, I was about to follow up on that with him.
23:33 Emilian
I put in a ticket, maybe it will get changed
23:33 AzMoo
Magus-: I'm not talking keys, I'm talking about the label displayed by errors.as_ul
23:33 Emilian
#6705
23:33 DjangoBot
23:33 AzMoo
Emilian: Thanks for that mate, much appreciated.
23:33 Emilian
no problem
23:35 AzMoo
Magus-: Although looking at the actual code for that part of it I see what you mean, but I think there'd be a better way to do that.
23:35 FunkyBob
DRY... you already have the field label in the field list...
23:35 AzMoo
Yep, it's just longer.
23:36 AzMoo
Wait, what does DRY mean?
23:36 Magus- just uses {{ form.foo.errors }} next to the field location
23:36 brehaut
dont repeat yourself
23:36 AzMoo
Magus-: Yeah, it doesn't fit in this layout though, so I figured I'd put them all on top.
23:37 Emilian
same here
23:37 Emilian
it shouldn't be that hard to pass it in along with e.messages
23:37 Magus-
Emilian: time to write a patch then ;)
23:37 Emilian
I've thought about it
23:37 Emilian
lol
23:38 Emilian
the way I'd do it is by having the value be a dictionary with a label key and an errors key
23:38 brehaut
does anyone know what file in django actually loads the settings file?
23:38 AzMoo
Now, this ticket: http://code.djangoproject.com/ticket/4046 <-- Is the reason that ubernostrum's patch hasn't been included because of the lack of tests?
23:39 Magus-
brehaut: django.conf would likely give you a hint to that
23:39 AzMoo
Emilian: I think that'd be a great idea, but I'm thinking totally backwards incompatible.
23:39 Magus-
since you do "from django.conf import settings" to get at them
23:40 brehaut
yes
23:40 brehaut
i had missed the __init__
23:40 brehaut
i havent been in python or django land for a while
23:42 Emilian
I don't see what it has to be compatible with
23:42 necrite
in the doc of django auth it say that we have to use login( request, user ) but when I run the code I get login() takes exactly 1 argument (2 given) .. any idea?
23:43 Magus-
necrite: don't name your view login, of course
23:43 Magus-
;)
23:43 Emilian
that one got me too when I started as well
23:43 Emilian
ha ha
23:43 Emilian
WTF IS GOING ON?!
23:43 Emilian
D:
23:44 AzMoo
Emilian: Existing code? Such a change would break anybody using ErrorDict, wouldn't it?
23:44 bem
anyone using django.contrib.gis with the admin application?
23:44 necrite
Magus-, heheh is the most standar method :P
23:45 brehaut
anyone know if there is a way to get a reference to the module that statements are executing in ?
23:45 Magus-
brehaut: why?
23:46 brehaut
magus: so i can dynamically add attributes to it
23:46 Magus-
why?
23:46 brehaut
so i can have attributes injected into a settings file dynamically
23:47 Magus-
why?
23:47 amerinese
can i specify a custom widget for just one _instance_ of a newform?
23:47 Magus-
jump to the end result already
23:47 Magus-
there's likely an easier way to do things
23:47 FunkyBob
brehaut: enough with the how... tell us the WHY
23:48 polpak
brehaut: you have a problem you're attempting to solve via this method. What is the problem.
23:48 Sunmaster_14
I'm having the following problem: http://dpaste.com/37833/ I checked the db, and the value I entered is definitely in there.
23:48 brehaut
as much as anything its to see if i can. currently the project ive become involved in uses a bunch of if switches based on host name to let devs configure the settings (mostly DB etc) to their local machine configurations
23:49 brehaut
i want to bust those out into their own domain based files
23:49 Magus-
there's a far easier method for that
23:49 brehaut
then import the relevant ones
23:49 Magus-
insanely easier
23:49 Magus-
Sunmaster_14: you need to set it with a date object, not a string
23:50 Sunmaster_14
oh, ok
23:50 Magus-
23:50 Sunmaster_14
but it didn't complain at me when I saved it.
23:50 Magus-
put that at the end of the file, then devs can have their own "local_settings.py"
23:50 Magus-
it imports and overrides and boom
23:50 Magus-
"the file" == settings.py, btw
23:50 brehaut
yes i was aware of that
23:50 brehaut
thats what i do myself
23:50 Magus-
just don't put local_settings.py in source control
Page 24 of 25   ← Previous  Next →(2,405 total)