Localization and date format

2010-04-24 Thread pjmorse
Is there any way to force a particular localization on date formatting? Our site (Django 1.0.2, Python 2.5) was set up with "UK" as the language code for the U.K. This apparently didn't cause any problems for years, but now that the person who made that decision is out of arm's reach, it's been di

Re: OS X install, not in home directory?

2010-04-24 Thread pjmorse
On Apr 24, 3:03 am, Rob wrote: > Maybe this is more of a general python question, but when I run `sudo > python setup.py install` it insists on putting the django package in ~/ > Library/Python/2.6/site-packages.  I want to install it in the system > site-packages, so it get's picked up by apache

Re: Error in image upload while copying file

2010-03-31 Thread pjmorse
On Mar 30, 10:53 am, bruno desthuilliers wrote: > Uh. Oh, well - then you indeed have a problem :( > Hum... Is that legacy code ? Looks pretty ugly to me - wouldn't pass a > code review here. > Well, assuming you're using at least Django 1.0, I suggest you get rid > of this mess and make appropri

Re: Error in image upload while copying file

2010-03-29 Thread pjmorse
On Mar 29, 8:22 am, bruno desthuilliers wrote: > On 19 mar, 20:05,pjmorse wrote: > > > In my application's admin console, there's a tiny form for updating > > the image associated with a specific model. > > > When a file is uploaded, the applicatio

Re: Error in image upload while copying file

2010-03-29 Thread pjmorse
d a "more compatible" copy method. (My web searches so far have been fruitless, because the keywords are too common.) Can anyone point me in the right direction? Thanks, pjm On Mar 19, 2:05 pm, pjmorse wrote: > In my application's admin console, there's a tiny form

Error in image upload while copying file

2010-03-19 Thread pjmorse
In my application's admin console, there's a tiny form for updating the image associated with a specific model. When a file is uploaded, the application reaches this code: if request.method == 'POST': file = request.FILES.copy() ...and fails with this error: object.__new

Re: Editing a model in console: form validation fails

2010-02-04 Thread pjmorse
On Feb 3, 2:10 pm, Daniel Roseman wrote: > On Feb 3, 5:45 pm, pjmorse wrote: > > I narrowed the problem down to form validation in the view, and using > > pdb and some debug logging commands I got the validation errors out. > > Here's the problematic code: > &g

Editing a model in console: form validation fails

2010-02-03 Thread pjmorse
I'm trying to sort out a problem in the console with editing an object. The user-reported problem, which I verified, is that changes made in the edit form are not made in the database; the user gets no error message, but their changes aren't made, either. I narrowed the problem down to form valida

Re: Saving several copies of an object

2010-01-06 Thread pjmorse
On Jan 5, 1:11 pm, Matthias Kestenholz wrote: > This won't do it, because ns is a Form, not a Model object. Something > like this might work though: > > obj = ns.save(commit=False) > > for language in languages: >     obj.id = None >     obj.language = language >     obj.save() > > Matthias Thank

Saving several copies of an object

2010-01-05 Thread pjmorse
I recently picked up a Django project from another developer, and I seem to have introduced an annoying bug. It's a multi-language site: US, UK, DE. (Why US and UK are considered different languages is organizational politics beyond the scope of my work.) When a "news article" is created, its body