2008-3-28
| 21:18 | subsume|work | tyrion-mx: of course. but that's your choice, not django's. |
| 21:19 | tyrion-mx | subsume|work, yes, but how can I tell to a archive_day view to get only the needed stuff, I guess I can't |
| 21:19 | subsume|work | tyrion-mx: I don't see the barrier, I guess. |
| 21:21 | jhenry | hoangelos: yes. |
| 21:22 | tyrion-mx | I am not understaing |
| 21:23 | subsume|work | me either. |
| 21:24 | emperorcezar | Is there a way to selectivly remove an item from a queryset? |
| 21:24 | subsume|work | I am attempting to give the user an option to autofill one form field on a form for 'fruit'. I am passing users/fruit/basket=2. If basket=2 was passed, I should pass it to the FruitForm and set it as the default value, right? |
| 21:26 | Ultraah | pjcrosier: the urls / generic views worked again fine, but i can't seem to display objects in my object_detail view |
| 21:27 | Ultraah | pjcrosier: same problem i had when i did this the first time, so i created a wrapper |
| 21:29 | Ultraah | pjcrosier: nevermind got it =X |
| 21:29 | tyrion-mx | So how should I do to make an archive_day view load |
| 21:29 | tyrion-mx | only the needed stuff |
| 21:29 | subsume|work | tyrion-mx: using generic views or your own? |
| 21:29 | tyrion-mx | generic views |
| 21:29 | truebosko | What exactly does this mean? 'str' object is not callable on line: form = form_class(request.POST) |
| 21:30 | pjcrosier | tyrion-mx, have you checked what query it actually performs |
| 21:30 | tyrion-mx | the goal is not to write my own "wrapper views" |
| 21:30 | subsume|work | tyrion-mx: I thought the generic date views already had mechanisms to do what you want. |
| 21:30 | subsume|work | truebosko: I run into that sometimes...its an obvious bug but I forget what. paste if you want. |
| 21:30 | Magus- | truebosko: probably that form_class is a string, of course |
| 21:30 | hoangelos | jhenry: do you know if mod_wsgi can only be used with the version of python that it was compiled against? |
| 21:31 | hoangelos | I'm trying to see if I can install two versions of pythons and serve one with mod_python and another with something else, so I can move to it slowly |
| 21:31 | jhenry | I don't know; I compiled my whole toolchain. |
| 21:31 | tyrion-mx | pjcrosier, I read the code, It not performs any query (if I understood), it uses the "queryset" keyword-arg |
| 21:32 | pjcrosier | yep, but at some point a query happens, which seems to be your concern |
| 21:32 | truebosko | Magus- Ah yes, my bad |
| 21:32 | hoangelos | jhenry: thanks. was hoping not to have to do that honestly |
| 21:33 | tyrion-mx | The query should happen in my "info_dict" where I put Entry.objects.all() |
| 21:33 | pjcrosier | tyrion-mx, but it's lazy |
| 21:33 | Typh | Anyone know offhand how to prevent the admin interface from automatically adding in paragraph tags? |
| 21:34 | jhenry | hoangelos: theoretically you should be able to just compile mod_wsgi on your system and go from there without compiling a new python interpreter, etc. |
| 21:34 | jhenry | though you may be able to run it with a different version of the interpreter; i'm not an expert on it. |
| 21:34 | hoangelos | yeah. it's hard I'm trying to get satchmo going |
| 21:35 | hoangelos | but I'm running 2.3, because running centos 4.2 |
| 21:35 | hoangelos | and I don't like compiling. I'd prefer an RPM, but can't find an RPM that gives me both python and mod_python for 2.4 |
| 21:35 | hoangelos | maybe I'll just search for an SRPM |
| 21:36 | jhenry | hoangelos: compiling mod_wsgi is pretty easy. just download the source, make sure you have httpd-devel installed, specify path to axps and load the module in your moduledir. |
| 21:36 | jhenry | that sounds a lot harder when i say it, doesn't it. |
| 21:37 | hoangelos | well I have an RPM for mod_wsgi |
| 21:37 | hoangelos | but I'm sure it's linked to my current python 2.3 |
| 21:37 | hoangelos | I found 2.4 as an RPM from pyvault |
| 21:37 | hoangelos | but that means I'd need to at least compile that unless I can find a SRPM I guess |
| 21:37 | Magus- | why would mod_wsgi be linked against /any/ python? |
| 21:37 | hoangelos | I thought it was |
| 21:37 | Magus- | doesn't it just speak wsgi to anything? |
| 21:38 | Magus- | mod_python is the one linked to python... |
| 21:38 | hoangelos | so how does mod_wsgi know what version of python to hand off to? |
| 21:38 | hoangelos | is that done in my app then or some config file I assume |
| 21:38 | jhenry | Magus-: mod_wsgi can run python inside the interpreter, so that's the only reason that I'm fuzzy on whether it has an interpreter compiled into the module. |
| 21:38 | subsume|work | I am attempting to give the user an option to autofill one form field on a form for 'fruit'. I am passing users/fruit/basket=2. If basket=2 was passed, I should pass it to the FruitForm and set it as the default value, right? |
| 21:39 | jhenry | blah. can run the interpeter inside the apache process. |
| 21:39 | Ultraah | pjcrosier: thanks so much for the insight, i was making it way more complicated than it had to be |
| 21:40 | hoangelos | sounds like worst case I'll need to get a SRPM of mod_wsgi and compile it against the version I want of python, but no harm in trying to just use it I guess |
| 21:41 | tyrion-mx | pjcrosier, be patient but I don't understand what "it's lazy" means |
| 21:41 | stunsch | I'm trying to set up a development server on a Windows box with Apache and mod_python. Apache and mod_python are installed. I am now setting up Apache, following this guide: http://www.djangoproject.com/documentation/modp... |
| 21:42 | subsume|work | Magus-: hate to bug you personally but could you chime in my above comment. |
| 21:42 | stunsch | The problem is that it doesn't want to start serving my django project |
| 21:43 | stunsch | I have placed the django project inside the htdocs directory |
| 21:43 | stunsch | manage.py runserver still works |
| 21:43 | pauloz | Generally you want to put your project outside of htdocs |
| 21:44 | subsume|work | stunsch: my django directory is at /var/django/ |
| 21:44 | pjcrosier | tyrion-mx, you were concerned that objects.all() would be executed each time you use archive_day? |
| 21:44 | tyrion-mx | Ah, you were talking about "lazy evaluation"! I didn't think that django were so smart |
| 21:44 | stunsch | it was acually outside, but didn't know how to make it work. |
| 21:45 | subsume|work | tyrion-mx: yeah. its lazy! =) |
| 21:45 | tyrion-mx | pjcrosier, yes I was thinking that everytime I called all() it does the query |
| 21:45 | stunsch | I have added the location tag to the httpd.conf file, but am not sure about this line: "SetEnv DJANGO_SETTINGS_MODULE mysite.settings" |
| 21:45 | pjcrosier | tyrion-mx, the actual query is very specific, it builds on the objects.all() you provide but it is only evaluated in it's more specific form :D |
| 21:45 | stunsch | Not sure what mysite.settings should say |
| 21:46 | pjcrosier | tyrion-mx, example query - http://dpaste.com/41908/ |
| 21:46 | tyrion-mx | Ok, thank you all :) |
| 21:46 | pauloz | If you have created a project called 'someproject' it should read someproject.settings |
| 21:46 | subsume|work | How could I override __init__ on a ModelForm and give it a default value? self.fields['field'].set_the_default_damnit('default_value') ? |
| 21:47 | pauloz | And you need to make sure that the *parent directory* is on the python path |
| 21:48 | subsume|work | ^^ initial value, I mean |
| 21:48 | tyrion-mx | I was thinking so, because I saw the results on the console when I did objects.all(), and I was expecting something like: <a Query Object (not executed)> |
| 21:55 | PhiR | anyone ever got trouble with the test clients not being able to login ? |
| 21:55 | PhiR | i'm logging in alright with the browser |
| 21:55 | PhiR | but on the same DB the client.login() returns a 500 page with 'tuple' object is not callable |
| 21:56 | cabrilo | hello all... is it feasable to run a couple of low traffic websites on a 256mb server? |
| 21:56 | cabrilo | django powered websites |
| 21:56 | Magus- | I do |
| 21:56 | cabrilo | and what would be the best option to serve them and consume memory? |
| 21:56 | subsume|work | form = ContactForm(request.user,initial={'service' : request.GET['service']},instance=model) <--- 'service' is not populating with initial. why? |
| 21:56 | cabrilo | Magus-: how do you do it? |
| 21:57 | Magus- | what do you mean? |
| 21:57 | Magus- | subsume|work: because the instance provides the data |
| 21:57 | cabrilo | Magus-: which server, apache, lighttpd...? mod_python/fastcgi/something else? |
| 21:57 | Typh | Anyone? -> Know offhand how to prevent the admin interface from automatically adding in paragraph tags? |
| 21:57 | subsume|work | Magus-: in this case instance=None |
| 21:57 | valiza1 | is it possible to change the value that a filter or get lookup returns if there are zero records found ? |
| 21:59 | Magus- | cablehead: I use apache/modpython |
| 21:59 | Magus- | valiza1: no |
| 22:00 | subsume|work | Magus-: even without instance=model the initial isn't populated. |
| 22:01 | cablehead | Magus-: that's good to know |
| 22:01 | cabrilo | Magus-: right... thanks |
| 22:01 | Magus- | subsume|work: are you sure you're matching the right field name also? |
| 22:01 | dcramer[] | hrmm when I use os.system, do I check for 0 as a failure status? |
| 22:01 | subsume|work | Magus-: its an FK. should I pass it as service_id? |