2008-3-23

21:58 noahz
and more effective for my needs
21:58 thunderbolt
dcramer[]: Well then, plasTeX it is then ;-)
21:58 empty
noahz: yeah. Well we are hooking into django's syntax. And also exposing the SA QUery if you want.
21:59 dcramer[]
anyone have any idea what causes this: http://sysdexia.com/
21:59 dcramer[]
it might be related to mod_wsgi
21:59 noahz
empty: that'll be really slick
21:59 thunderbolt
empty: Is there a good URL to look at for information on django-sqlalchemy?
22:00 empty
noahz: so for example right now if I do Category.objects.filter(name__contains='a') that would be the same as Category.query.filter(Category.name.like('%a%'))
22:00 empty
22:00 empty
that has all the relevant links at the bottom.
22:00 thunderbolt
empty: Thanks.
22:08 dcramer[]
No one at all -.-
22:09 implor
I'm trying to create a python script for reading a series of rss feeds and adding them to a db, if a story exist in db, it should not add it but it still do. can anyone check my script? http://dpaste.com/40929/
22:10 |Kev|
I've got a semi-algorithmic question about Django: I have a hierachical structure, (a model which has itself as a foreign key (parent)) - it's not clear to me how to do this in a template to arbitrary depth, could anyone point me in the right direction please?
22:14 \C-g
|Kev|: there's an {% include %} directive in the django template language, you can probably use that to have a template recursively include itself
22:14 |Kev|
ah, that might work, thanks very much :)
22:14 AlexB
Ouch.
22:15 |Kev|
ah, that won't work anyway, will it?
22:15 |Kev|
you can't pass a parameter to an include file?
22:15 iggy
that's a big change...
22:15 iggy
I wrote a gallery app about 2 months ago
22:15 iggy
just noticed something wasn't working right
22:15 iggy
went in and fixed it in about 10 mins
22:16 \C-g
|Kev|: You can't pass a parameter, but the include file does have access to the current in scope template variables which amounts to basically the same thing
22:16 iggy
anytime I have to go back and fix php code I wrote 2 months ago, I spend 4 hours trying to figure wtf it's doing first
22:16 iggy <3 django
22:17 Xore
iggy: doesn't make php a good or a bad language, php is just more accessible, so you have many more so-called coders writing stuff with it
22:17 |Kev|
\C-g: hrmm - only if scopes work oddly, I think
22:18 \C-g
|Kev|: I've used that "feature" before, so I'm pretty sure it works
22:18 |Kev|
ok, let me think about this
22:18 \C-g
maybe not the cleanest way of doing things
22:18 \C-g
the alternative is to write a special template tag
22:19 iggy
Xore: my comment was more for praise of django than belittling php
22:19 \C-g
I believe there's a helper function somewhere in there for creating special include-like template tags that take arguments
22:19 iggy
obviously I'm writing php for a living, so I'm at least that okay with it's further existence
22:20 dcramer[]
[530]: you around?
22:21 Xore
iggy: yea. i used to do a lot of php, it's just as soon as you move into a team environment, quality control tends to go out the window
22:22 iggy
tell me about it
22:22 iggy
it's even better when the team has never heard of things like svn
22:22 iggy
or unit tests
22:22 iggy
or table-less layouts
22:23 dcramer[] pokes ubernostrum
22:23 hylje
svn is outdated
22:23 hylje
but better than nothing
22:24 iggy
but at least you've heard of it
22:24 hylje
that is a given
22:24 huyqt
Is there anyway to compare 2 datetime filtered through date in django's template system? e.g., {% ifequal start_datetime|date:"F d, Y" end_datetime|date:"F d, Y" %}
22:25 huyqt
so that it doesn't compare the time, only the date
22:26 valizas
how is the shell command to reset the superuser password in an app?
22:27 hylje
22:28 hylje
reading through the docs for fun and profit recommended
22:28 pjcrosier
huyqt, if that doesn't work, might be time to make your own tag
22:28 hylje
so that one doesn't need to use the human search engine that often
22:28 huyqt
blast.
22:29 pjcrosier
does it work? ;D
22:29 huyqt
no.
22:29 huyqt
haha
22:31 valizas
hylje: tks.
22:33 valizas loves when things work out
22:33 pjcrosier
ah, huyqt
22:33 huyqt
pjcrosier: ?
22:33 valizas
does enyone know if the pycon django presentations are available online?
22:34 pjcrosier
huyqt, http://dpaste.com/40932/ seems to work?
22:34 Uz_
huyqt: i think it should work.
22:35 Uz_
pjcrosier: he wants to compare month date and day, not hour and minutes of datetime.
22:35 Uz_
huyqt: I think datetime objects have a way toget a date object.
22:35 pjcrosier
yep, i'm just comparing the date portion
22:36 Uz_
{% ifequal start_datetime.date end_datetime.date %}
22:37 Uz_
pjcrosier: sorry.. didnt fully read it and thought x and y are models ^^
22:37 bastih^LISP
Uz, maybe write your own filter ;D
22:38 pjcrosier
nope, just me messing around in the shell ;D
22:38 Uz_
bastih^LISP: talk to huyqt. I don't think this needs a filter/tag tho.
22:38 huyqt
hmm
22:38 bastih^LISP
if you need to compare the date von datetime?
22:38 huyqt
one sec.
22:38 Uz_
bastih^LISP: datetime objects have date method which returns a date object.
22:39 Uz_
aside from this, applying filters on the arguments of ifequal should do the job as well.
22:39 Zalamander
hylje compare start_datetime.date with end_datetime.date
22:40 huyqt
Yeah, I think it should work.
22:40 frimjon
Hi folks.
22:40 Uz_
Hi.
22:43 frimjon
I'd like to place "session IDs" in the database, so that the current session of the user is logged. From what I've seen Django doesn't provide an automatically generated session ID; would the right way to go be randomly generating one and placing in the database?
22:43 Zalamander
frimjon hm, have you seen the "sessions" documentation?
22:43 frimjon
Yes, Zalamander.
22:44 Zalamander
what does that not provide?
22:44 frimjon
A session ID.
22:44 Zalamander
then how is the session stored?
22:44 frimjon
I'm asking whether it would make sense to generate one mself.
22:44 Zalamander
I don't understand what makes you think sessions don't have Ids. They are stored in the database already, so they MUST have a unique id
22:44 frimjon
Probably using a stored cookie with a session ID. The API doesn't seem to reveal that ID, however.
22:45 frimjon
At least I can't see that on the /sessions/ page of the documentation.
22:45 Zalamander
hm, I would have thought it would be request.session.id
22:45 Zalamander
just a guess though
22:46 frimjon
Not according to Google, it seems.
22:46 frimjon
Does Django have some sort of epydoc generated documentation of sorts?
22:47 Magus-
out of curiousity, why do you need the session id?
22:49 frimjon
I would like to keep it for my logs.
22:49 frimjon
Coupled with an IP, it'll help detect abuse when reviewed.
22:49 Magus-
can't just read it from the cookie?
22:49 frimjon
That'd work, Magus-.
Page 21 of 22   ← Previous  Next →(2,128 total)