2008-8-28
| 23:36 | p-- | hahah |
| 23:36 | p-- | thanks |
| 23:36 | mattmcc ponders what solving actual problems deserves if pointing out elementary python errors gets a brewery. | |
| 23:36 | Magus- | hey FunkyBob, did you catch the writeup on capistrano? (i can't recall if you were interested in that or not) |
| 23:37 | jose | hello all, I got a question about databases |
| 23:37 | FunkyBob | Magus-: no, I didn't... (and yes, I am vaguely) |
| 23:37 | p-- | mattmcc, it's not that I didn't know that, I just been looking at this for a fucking hour and didn't notice it until he just said that |
| 23:37 | Magus- | answer: SELECT 42; |
| 23:37 | Magus- whistles innocently | |
| 23:37 | FunkyBob | what I need to check now is proper usage of get_or_create |
| 23:37 | FunkyBob | Magus-: hehe |
| 23:37 | hooch | win 25 |
| 23:37 | mattmcc | p--: Ah. A good practice when being stuck on a problem for what seems like 'too long' is to get up and walk away from the computer. |
| 23:38 | mattmcc | Focusing too hard often makes it less likely to find the cause. |
| 23:38 | jose | I've defined a row for an email address |
| 23:38 | jose | but I've defined it as charField |
| 23:38 | rbd_ | quick question, would the following snippet work with a form.ModelForm: http://www.djangosnippets.org/snippets/165/ |
| 23:38 | FunkyBob | explaining it to someone else (preferably spoken) often helps, too |
| 23:38 | p-- | mattmcc, I know.. Im leaving for the weekend in a few hours and wanted to get these changes done :) |
| 23:38 | jose | is there a way to modify it as EmailField? |
| 23:38 | p-- | mattmcc, instead im now behind schedule |
| 23:38 | mattmcc | p--: Wel,l I didn't mean that drastic. Like get up, walk around outside for a few minutes, have a snack.. |
| 23:39 | mattmcc | Just enough to get you to stop thinking about the problem. |
| 23:39 | Magus- | rbd_: the validators are gone |
| 23:39 | p-- | mattmcc, yea.. you're right.. |
| 23:39 | Magus- | not just validator_list |
| 23:39 | p-- | anyways, thanks again Magus- |
| 23:39 | Warcrime | If I a multiple choice question, which can either have 4 multiple choice answers, or 2 (true/false) answers. What is the best way to design these models? One question and one answer object which links via foreignkey to the question model? |
| 23:39 | Magus- | Warcrime: don't repeat yourself so fast |
| 23:39 | Magus- | we saw the question |
| 23:39 | Magus- | we have no answer |
| 23:39 | Magus- | hence, no response |
| 23:39 | gkelly | jose: I believe the underlying database column is the same, but you can always check by looking at what manage.py sql says |
| 23:40 | terral | Warcrime: it seems like suboptimal Model planning. |
| 23:40 | FunkyBob | ah... seems I was mistooked... get_or_create saves the new object for you |
| 23:40 | jose | I deleted de "Email" row from de DB manually, but now I do a SyncDB and it does not create anything |
| 23:40 | Warcrime | What do you mean by that terral? |
| 23:40 | jose | shoudn't it rebuild it? |
| 23:41 | gkelly | jose, not if the table already exists. Django won't modify existing data |
| 23:41 | Magus- | jose: you mean you deleted the /table/ ? |
| 23:41 | Magus- | or do you mean column? |
| 23:41 | Magus- | django doesn't make rows on syncdb |
| 23:41 | jose | I deleted the column |
| 23:41 | Magus- | yah, no |
| 23:42 | Magus- | django doesn't modify existing tables, as gkelly said |
| 23:42 | Magus- | so it will never add/remove columns |
| 23:42 | jose | oh... so if I delete the table it will create it again? |
| 23:42 | terral | Warcrime: well, it really sounds like you need 2 different types of questions. |
| 23:42 | Magus- | yes |
| 23:42 | jose | great, thanks then |
| 23:43 | rskumar | is mod_wsgi preferred over mod_python while deploying on apache |
| 23:44 | snipe65 | hey guys, I've installed and enabled memecached on my django setup. I'm also using django's session implementation, and I wanted to know is there a way I could force django to write session info to the db every once in a while ? Basically the way its working, is that sessions are in memecached and nothing is written out to the database, obviously this poses a bit of a problem if I reboot my server or it crashes.... |
| 23:44 | Magus- | snipe65: write your own backend |
| 23:46 | snipe65 | is there a howto on how I would go about doin that ? :| |
| 23:46 | largos | django's send_mail(...) method appears to hang indefinitely when I try using it -- can anyone suggest some debugging techniques to see what's up? (is there a debugger I should be using?) |
| 23:47 | rskumar | largos: you can use winpdb debugger, just choose the file where you calling, set breakpoints and run the django server thats it... |
| 23:48 | Magus- | snipe65: not that I'm aware of - just start with an existing backend |
| 23:48 | largos | rskumar: thanks! I just found some tips on setting up django w/ gmail, so I'm trying that first... |
| 23:49 | snipe65 | Magus-: when you say backend do you mean something along the lines of django.contrib.sessions.middleware.SessionMiddleware ? |
| 23:50 | Magus- | no... |
| 23:50 | snipe65 | I'm a bit new to this :| |
| 23:50 | Magus- | note the "backends" folder in contrib/sessions |
| 23:50 | Magus- | maybe I'm talking abou tthose... :รพ |
| 23:50 | snipe65 | thanks :) |
| 23:53 | snipe65 | now, in your opinion would it be better to "customize" the current session's backend or completely write my own ? |
| 23:53 | Magus- shrugs | |
| 23:53 | juice_d | sorry to bother you again Magus- , I have a choices field in my mode, but self.choice returns the int of the choice, is there a way to pull the value instead of the key |
| 23:53 | juice_d | kind sir |
| 23:53 | snipe65 | ok |
| 23:53 | Magus- | juice_d: do not nag me directly with questions |
| 23:54 | Magus- | ask the channel |
| 23:54 | Magus- | if I know, I speak |
| 23:54 | juice_d | will do |
| 23:55 | gkelly | juice_d: get_choice_display should do it |
Page 34 of 34
← Previous
(3,374 total)