2008-3-28

22:01 Magus-
try it
22:01 valiza1
is it possible to call a class somehow -not an objectoof it- and get a string of its identity ?
22:02 subsume|work
Magus-: nope. not even if I remove instance=model. I ought to mention request.GET['service'] = u'1'
22:02 subsume|work
maybe change it to int?
22:02 gordonjcp
what's a good way to store user-adjustable variables in Django?
22:02 stunsch[1]
I cannot configure right django to work with Apache and mod_python. I get an error: ImportError: Could not import settings 'itprojectes.settings' (Is it on sys.path? Does it have syntax errors?): No module named itprojectes.settings
22:03 gordonjcp
things like VAT amounts for an online shop, for instance
22:03 stunsch[1]
What is sys.path?
22:03 gordonjcp
stunsch[1]: sys.path is the path that Django uses to find things
22:03 gordonjcp
stunsch[1]: it sounds like you haven't quite got your PYTHONPATH thing set up correctly
22:03 fenestro
gordonjcp: one way is a single-row database table, with a column for each configuration item
22:03 dcramer[]
ok 0 is success it seems
22:03 gordonjcp
stunsch[1]: can you pastebin the relevant bit of your apache config?
22:04 gordonjcp
fenestro: that seems rather ugly
22:04 phatmonkey
can I reassign variables in templates? I have a really cumbersome backwards fk that I don't really want to write out loads of times
22:04 gordonjcp
fenestro: what I did think of was a model with a key and a value column
22:04 fenestro
gordonjcp: it's not particularly pretty, but it does mean that the admin interface can be used to edit the values
22:04 gordonjcp
phatmonkey: you could probably do it in a view
22:05 robhudson
phatmonkey: look at the "with" tag
22:05 phatmonkey
gordonjcp: nah, I'm using generic views, no point then
22:05 gordonjcp
fenestro: what I was going to do was make the key the pk for the model
22:05 springmeyer
I am working with the newforms-admin branch and it looks like per-object permissions are possible given this changeset: http://code.djangoproject.com/changeset/4324
22:05 stunsch[1]
22:05 subsume|work
Magus-: so here's something interesting. Select=selected and yet the select box is stubbornly default selecting ------------
22:05 phatmonkey
robhudson: I can't find any documentation on it
22:05 springmeyer
Does anyone have examples of how to use it?
22:06 phatmonkey
waity, yes I can
22:06 fenestro
gordonjcp: yep, if they're all of the same type
22:06 phatmonkey
robhudson: that's perfect, thanks
22:06 springmeyer
I'd like users to only be able to view/edit/change records/rows they have created
22:06 subsume|work
Magus-: meh. caching issue. thanks.
22:07 pjcrosier
stunsch[1], so your settings are at 'D:/Stefan/Mis Documentos/04. Desarrollo/05. Django/02. Projectes/01. Formació/ITProjectes/itprojectes/settings.py'?
22:07 pjcrosier
and wow at the length of that :D
22:07 stunsch[1]
yes, that's right
22:08 stunsch[1]
sorry
22:08 stunsch[1]
no
22:08 stunsch[1]
just one time itprojectes
22:08 stunsch[1]
D:\Stefan\Mis Documentos\04. Desarrollo\05. Django\02. Projectes\01. Formaci�Projectes\settings.py
22:09 pjcrosier
use 'D:\Stefan\Mis Documentos\04. Desarrollo\05. Django\02. Projectes\01. Formació' and 'ITProjectes.settings' then
22:13 Kakeman
i want to do some kind of psuedomodel or something
22:14 stunsch[1]
pjcrosier: still not working
22:14 stunsch[1]
ImportError: Could not import settings 'itprojectes.settings' (Is it on sys.path? Does it have syntax errors?): No module named itprojectes.settings
22:14 Kakeman
which content would be generated from other models
22:14 pjcrosier
stunsch[1], itprojectes would be case sensitive, is it actually ITProjectes?
22:15 stunsch[1]
No :( Just a sec
22:16 cyr0715
quick question, i'm unfortunately on windows.. what text editors or IDE's do people use?
22:16 JohanSoderberg
i use vim
22:17 cyr0715
thx
22:17 JohanSoderberg
np ;)
22:18 stunsch[1]
pjcrosier: No, this isn't working.
22:19 pjcrosier
why did you use ITProjectes originally if it doesn't exist?
22:20 stunsch[1]
I'm confused... ITProjectes is how I named my django project.
22:20 pjcrosier
<pjcrosier> stunsch[1], itprojectes would be case sensitive, is it actually ITProjectes?
22:20 pjcrosier
you said no
22:21 pjcrosier
you meant yes? :D
22:22 pjcrosier
stunsch[1], PythonPath "['D:/path/to/parentofproject'] + sys.path" - note the / instead of \
22:22 stunsch[1]
it is ITProjectes. I changed my httpd.conf file to say "SetEnv DJANGO_SETTINGS_MODULE ITProjectes.settings", where before it said itprojectes.settings. Tried again and no success.
22:22 pjcrosier
stunsch[1], SetEnv DJANGO_SETTINGS_MODULE ProJeCt.settings
22:23 stunsch[1]
pjcrosier: That is how it is right now...
22:24 pjcrosier
what does your conf look like now, dpaste?
22:26 stunsch[1]
pjcrosier: Things have started to work. It must be this long path, that includes accents. I have moved ITProjectes to the root of D and changed httpd accordingly
22:28 nsaaman
/away Gone for now.
22:29 implor
question, do django have a built-in page generate function? like if your data is to mucj for one page.
22:29 pjcrosier
implor, pagination
22:30 pjcrosier
22:30 pjcrosier
ah stunsch[1], i'm not too sure about the specifics of django / windows and apache so i'm glad it works at least :D
22:31 stunsch[1]
pjcrosier: buff... Let's see if I get my media files to load now...
22:32 implor
pjcrosier, thax, this will make my day. =)
22:40 prs
Hi all
22:41 gordonjcp
bloody ricers
22:43 gordonjcp
prs: hi
22:43 gordonjcp
(I would have replied sooner but I was compiling my reply)
22:43 prs
:-)
22:44 valiza1
how can I obtain the url to the admin interface for an object ?
22:47 pjcrosier
valiza1, {% url django.contrib.admin.views.main.change_stage app,model,id %} i think
23:01 implor1
pjcrosier, i'm getting "Could not parse the remainder: (0)", I have {% for story in story_list.get_page(0) %} in the template and "story_list = ObjectPaginator(Storys.objects.all().order_by('-id'), 20)" in the view
23:02 bastih
implor: djamgo templates don't support calling functions with parameters
23:02 bastih
*django :P
23:03 pjcrosier
implor, are you using an older django (not trunk)?
23:03 pjcrosier
but yeah, you don't do stuff like story_list.get_page(0) in templates
23:06 valiza1
pjcrosier: thank you. Do you think there is a way to obtain the url within python, besides from the template system ?
23:07 pjcrosier
valiza1, yep
23:08 pjcrosier
valiza1, reverse('django.contrib.admin.views.main.change_stage', args=[app, model, id])
23:08 pjcrosier
(from django.core.urlresolvers import reverse)
23:59 stunsch
I'm trying to set up template inheritance, but I'm unable to invoke the subtemplate
23:59 stunsch
my view calls an index.html template
23:59 Magus-
there is no 'invoking' the subtemplate
23:59 Magus-
you render the child template
23:59 Magus-
not the parent
Page 27 of 27   ← Previous  (2,689 total)