2009-7-29
| 23:38 | bluszcz | you are not able to help me, definitiely. |
| 23:38 | subsume | I wish you could explain |
| 23:38 | subsume | things properly |
| 23:38 | subsume | instead of |
| 23:39 | subsume | mashing the |
| 23:39 | subsume | enter button |
| 23:39 | subsume | and |
| 23:39 | subsume | ranting |
| 23:39 | subsume | its annoying |
| 23:39 | subsume | hard to follow |
| 23:39 | subsume | etc. |
| 23:39 | subsume | slooper: |
| 23:39 | subsume | slooper: anything you surround by parentheses is going to be passed. |
| 23:39 | bluszcz | subsume: yes, in this case you are completely right. however, it still doesn't resolve don't working test client. |
| 23:39 | igors | DarwinSurvivor, ModelChoiceField takes a queryset, not a model |
| 23:39 | subsume | slooper: you can even get really creative and use a non-matching group to limit to options 'cat','dog',etc. but. I would not do this |
| 23:39 | subsume | slooper: instead, what I would do, is pass in your arg directlry |
| 23:40 | subsume | url('asdfasdf/cat/add','views.view',{'type': 'cat'}) |
| 23:40 | DarwinSurvivor | igors: so use "MyModel.objects.all()"? |
| 23:40 | subsume | bluszcz: What is this business of something working in FF. What works in FF, and when? |
| 23:40 | slooper | subsume: I was hoping to avoid building a url for every model |
| 23:41 | subsume | slooper: you can use do animals/([^/]+)/add then |
| 23:41 | subsume | but keep in mind anyone can type anything in to animals/asdfasdfasdf |
| 23:41 | igors | DarwinSurvivor, not possible, to avoid circular imports maybe you could pass None to queryset parameter, and set the real queryset in __init__ of your form, and just import your model there |
| 23:42 | slooper | subsume: gotcha - how do I get the dog, cat argument from the regex? |
| 23:42 | DarwinSurvivor | igors: ok I can do that, but is my queryset example correct? |
| 23:42 | subsume | slooper: I just showed you |
| 23:42 | bluszcz | subsume: it works with any browser, even if you run netcat, telnet with putting GET /show / HTTP/1.1... the problem is in the django.test.Client |
| 23:42 | igors | DarwinSurvivor, yes, but you must pass the queryset itself, not a string |
| 23:42 | subsume | slooper: as you surely learned while reading the docs, parentheses capture and pass as args. |
| 23:43 | slooper | subsume: so many docs, so little time ;) |
| 23:43 | subsume | =). |
| 23:43 | bluszcz | so, anyone is using django.test.Client and checking a response.context or response.template in his tests? |
| 23:43 | andym | bluszcz: stick a pdb in and start debugging |
| 23:43 | DarwinSurvivor | igors: no problem. thank you for clarifying the queryset problem (the docs don't actually show an example of using ModelChoiceField, so it gets a little confusing) |
| 23:43 | andym | again bluszcz yes i am |
| 23:43 | slooper | subsume: thanks for your help, I'll run with it |
| 23:43 | bluszcz | andym: yeah, i set_trace, i wanted to avoid this ;) |
| 23:43 | subsume | slooper: you probably want to google 'non capturing groups regexp' |
| 23:44 | subsume | slooper: to limit choices /explicitly/ |
| 23:44 | subsume | * is foolish. |
| 23:46 | bluszcz | andym: can you share with me some piece of working recipe? |
| 23:46 | andym | a working recipe of what? |
| 23:47 | bluszcz | andym: response=client.get(...);resposne.context |
| 23:47 | andym | beyond whats in the docs, no |
| 23:47 | bluszcz | uh |
| 23:47 | mheld | y'all might be able to help with this: http://octui.com:8000/accounts/login/ |
| 23:48 | mheld | where did my side column go? |
| 23:48 | bluszcz | my little app is working like in the docs, actually i cannot find anybody who used it ;) |
| 23:51 | slooper | subsume: so I re-read the docs on URLs and the URL dispatcher, and I'm still having trouble passing a model name to the generic views |
| 23:52 | slooper | I have "r'^(?P<model>\w+)/create/', 'create_object'" |
| 23:52 | slooper | trying to pass the name of the model to the create_object view |
| 23:53 | slooper | looks like it's upset because I'm passing it a string and not the actual model class |
| 23:53 | catch_ | http://test.site.com:8000/admin/ornette/product... ... all the junk between :8000/ and site_media isn't necessary but is prepended to the link in the edit admin screen... so how do i keep it from doing that? |
| 23:54 | catch_ | nevermind |
| 23:54 | catch_ | i'm an idiot |
| 23:54 | ivazquez|laptop | You forgot a slash. |
| 23:54 | catch_ | yup |
| 23:54 | catch_ | i wish that was better explained in the docs |
| 23:54 | ivazquez|laptop | Doesn't it say that right in the file? |
| 23:55 | catch_ | which file? |
| 23:55 | ivazquez|laptop | The settings file. |
| 23:55 | catch_ | no |
| 23:55 | catch_ | it mentions the trailing slash |
| 23:55 | seanbrant_ | is there a python function that will take a list and return multiple lists of lists breaking up the original list by a integer? |
| 23:55 | catch_ | but in this case it was the starting slash that was missing |
| 23:56 | ivazquez|laptop | seanbrant_: No. |
| 23:56 | ivazquez|laptop | But look in itertools. |
| 23:56 | seanbrant_ | [1, 2, 3, 4, 5, 6, 7, 8, 6, 10] break by 2 return [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]? |
| 23:57 | andym | bluszcz: if you check out recipe_01 of cleardjango, it works just fine, adding in print response.context in the test works just great - http://code.google.com/p/cleardjango/source/bro... |
| 23:57 | seanbrant_ | ivazquez|laptop: thanks that was my next option |
| 23:57 | bluszcz | andym: looking |
| 23:58 | bluszcz | andym: http://code.google.com/p/cleardjango/source/bro... this? there is response.content, not context |
| 23:59 | andym | yes add in response.context and it works just fine (which is what i said) |
| 23:59 | bluszcz | lets try :) |
Page 33 of 33
← Previous
(3,275 total)