2008-3-10
| 23:28 | insanekane | is it too difficult to google for "django-evolution" ? |
| 23:28 | WickedMetalHead | in my opinion it's good it makes you manually alter the table, you should need to think about altering your database |
| 23:29 | insanekane | WickedMetalHead: yeah, just like manually having to craft SQL |
| 23:29 | insanekane | after all, you do need think about the resulting schema |
| 23:30 | ob3r0n | heh. i think the best way it's useng a new def class and using ForeignKey |
| 23:30 | davemeriwn | need some help with a view |
| 23:30 | davemeriwn | type object 'Staff' has no attribute 'object' |
| 23:30 | davemeriwn | that is the error I am getting |
| 23:30 | davemeriwn | will dpaste in one sec |
| 23:30 | ob3r0n | if i use foreignkey - it's dublicate fields? |
| 23:30 | davemeriwn | here is it: http://dpaste.com/38838/ |
| 23:31 | ob3r0n | davemeriwn objects |
| 23:31 | davemeriwn | UGH |
| 23:31 | ob3r0n | s += str(main.objects.count()) + '<br>' |
| 23:33 | davemeriwn | thanks for that... it is always the little things |
| 23:34 | ob3r0n | davemeriwn yep |
| 23:35 | SmileyChris | davemeriwn: another tip: from django.shortcuts import get_object_or_404 |
| 23:35 | SmileyChris | use that rather than just trying to get the slug directly |
| 23:35 | davemeriwn | ahhh cool |
| 23:36 | WickedMetalHead | is it required that django-admin.py be put in /usr/local/bin? can i just run it with a full path? |
| 23:36 | SmileyChris | WickedMetalHead: you can |
| 23:36 | SmileyChris | no requirement |
| 23:36 | ob3r0n | WickedMetalHead no |
| 23:36 | ob3r0n | WickedMetalHead sure. you can |
| 23:37 | johannix | i'm taking the value off the URL with a regex and want to accept null as well. For example: "/page/1" and also "/page". Right now the way I'm checking for the default case ("/page") is I'm checking against: "if page == u'':" is there any other way? |
| 23:37 | ob3r0n | WickedMetalHead django-admin.py it's equal ./manage.py |
| 23:37 | Quin7 | with django + apache , how do i have one location use PROJECT and another location use PROJECT B (two different django projects) |
| 23:37 | ob3r0n | johannix post /page after /page/1 |
| 23:37 | ob3r0n | Quin7 use site id for this |
| 23:38 | johannix | in the urls.py? |
| 23:38 | Quin7 | site id ? |
| 23:38 | ob3r0n | johannix yep |
| 23:38 | ob3r0n | Quin7 yep |
| 23:38 | tesseracter | odd. i do for query in query_set: query.delete() and....it doesnt delete :-P |
| 23:38 | johannix | ya, i was thinking about doing that |
| 23:38 | johannix | ok. thanks |
| 23:38 | SmileyChris | Quin7: it's documented |
| 23:38 | peritus | johannix: just set up a second url with /page/$, {'page': 1} .. |
| 23:38 | ob3r0n | (r'^main/login/$','mysite.main.views.login'), |
| 23:38 | ob3r0n | (r'^main/(.*)/$','mysite.main.views.other_main'), |
| 23:38 | ob3r0n | for example |
| 23:38 | SmileyChris | Quin7: i don't think you want site, i think you're just after the special advice |
| 23:38 | ob3r0n | johannix for you |
| 23:39 | ob3r0n | tesseracter qyery.save() |
| 23:39 | SmileyChris | |
| 23:39 | tesseracter | ob3r0n, so delete, then save? heh, ok... |
| 23:39 | ob3r0n | tesseracter offcourse) |
| 23:40 | ob3r0n | i'm go spoking |
| 23:40 | SmileyChris | tesseracter: just do query_set.delete() |
| 23:40 | tesseracter | SmileyChris, that'll get rid of everything? |
| 23:40 | SmileyChris | tesseracter: yep |
| 23:40 | SmileyChris | just like the docs say ;) |
| 23:40 | Quin7 | well my django installation powers two different projects with totally different databases and everything . would sites be able to accomodate this or is running two different django's through apache the best way to go |
| 23:41 | salkot | oh, it turns out zeeg is the one i emailed |
| 23:41 | SmileyChris | Quin7: you'll need two different djangos |
| 23:41 | SmileyChris | salkot: doh |
| 23:42 | jwhitlar | I need a pointer. I need a form with two drop down lists, with the second list filtered based on the first. (i.e. with state and city, only the cities in the selected state show up) I'm assuming javascript is needed for this? |
| 23:43 | mattmcc | Either that, or you need to submit the form in its partial state, and use that to build the second select. |
| 23:43 | mattmcc | Which would be a useful fallback for non-JS users. |
| 23:44 | jwhitlar | that would work for now. is that where multi-part forms come in, or am I completely off? |
| 23:45 | ob3r0n | SmileyChris hm. it's true? |
| 23:45 | SmileyChris | ob3r0n: ? |
| 23:45 | mattmcc | That depends on what you're referring to by 'multi-part form' |
| 23:45 | ob3r0n | zabey |
| 23:46 | SmileyChris | what an odd fellow... :) |
| 23:46 | jwhitlar | um. is there a section in the docs that deals with this sort of things. I didn't find it, but I might be looking in the wrong place. |
| 23:47 | SmileyChris | jwhitlar: it's not very well documented (but then, it's not a common request) - you need to override the form's __init__ method and build the second select in there |
| 23:47 | WickedMetalHead | anyone have any idea what the error would mean if when i run django-admin.py startproject somesite it goes ": No such file or directory". I manually created a project, and when i try to run ./manage.py syncdb, i get the same error |
| 23:48 | SmileyChris | jwhitlar: or probably easier, just use a separate form for it (you'll still need to override init to set up the query set right I'm guessing ) :) |
| 23:48 | gridlock | wrt with and block template tags, would would my with block outside a block not get picked up by the context of the block ? |
| 23:48 | SmileyChris | not if you're extending another template |
| 23:48 | gridlock | (eg {% with ... as foo %} {% block bar %} {{ foo }}... |
| 23:49 | gridlock | ah |
| 23:49 | gridlock | thats a pain |
| 23:49 | SmileyChris | why? |
| 23:49 | SmileyChris | just put it the other way round |
| 23:49 | gridlock | because i have 3 blocks that im extending |
| 23:49 | Magus- | well you can't extend blocks multiple times |
| 23:49 | gridlock | but it would be nice to share the with |
| 23:50 | SmileyChris | gridlock: then move some of that logic to the view ;) |
| 23:50 | Magus- | so a block in a for loop is silly |
| 23:50 | Magus- | er, wait, that was a with |
| 23:50 | jwhitlar | k. I'll look into that. tnx. |
| 23:50 | Magus- | but yah, doesn't matter |
| 23:50 | Magus- | there is no context outside blocks |
| 23:51 | gridlock | so is the current behavior not considered a bug or is it just not fixed? |
| 23:51 | Magus- | it isn't a bug |
| 23:51 | Magus- | in a child template, there is no context outside of blocks |
| 23:52 | gridlock | right. i guess thats fair. still a pain |
| 23:53 | salkot | gridlock, 'with' works surrounding an 'import', if that helps. |
| 23:53 | gridlock | salkot: almost but no :) |
| 23:53 | AzMoo | How do I go about submitting the values of buttons? I'm assuming I add the button name to my form definition as a CharField. Is there a better way to do it? |
| 23:53 | gridlock | nah, ive got a problem because of how previous team members designed the html |
| 23:54 | gridlock | and i am switching included templates based on a flag on the model |
| 23:54 | Magus- | AzMoo: uh, what? |
| 23:54 | gridlock | its a little hacky |
| 23:54 | gridlock | i will leave with nested withs |
| 23:54 | Magus- | the form object does NOT generate form buttons |
| 23:54 | AzMoo | Magus-: I want to submit the value of a button. |
| 23:54 | Magus- | so you just give the button a name/value |