Re: South - when to start?

2011-02-18 Thread ShawnMilo
Just to add my tiny bit to this: I say start with South right away. But when you're ready to deploy for the first time, wipe it all and to another --initial. The reason is that South is awesome for letting you upgrade a production app that isn't allowed to stop working. So at first deployment,

Re: Displaying (only) custom form fields in a template.

2010-10-27 Thread ShawnMilo
I found a solution, but it's kind of ugly. In the form I added this: self.fields[field_name].is_custom = True And in the model: {% for field in form %} {% if field.field.is_custom %} {{ field.label }} {{ field }}

Re: OS Error, Permission Denined

2010-10-07 Thread ShawnMilo
The problem here is most likely due to the forward-slash in front of your path name. Django's trying to actually write to a non-existant folder at a level you don't have access to in any case on shared hosting. Try taking it out and see if that fixes it. Shawn -- You received this message becaus

Re: A better way of checking if a record exists

2010-10-02 Thread ShawnMilo
Bruno, Great point. I've simplified my old code quite a bit with this suggestion. After creating a dictionary with 12 items in it, I use it for the default in get_or_create, then: [setattr(product, field, value) for field, value in new_values.items()] product.save() Thanks, Shaw

Re: how to retreive the body text alone of a webpage

2010-10-02 Thread ShawnMilo
Also, just to save you additional pain, do NOT install anything from the 3.1 series. It's deprecated and had problems. You want 3.0.8.x. According to the maintainer's site they're going to update the 3.0.8.x series to the 3.2.x series to avoid confusion in the future. http://pypi.python.org/pypi/B

manage.py ignores DJANGO_SETTINGS_MODULE

2010-07-04 Thread ShawnMilo
I have DJANGO_SETTINGS_MODULE set in my environment to an alternative settings file. The alternate file imports the original settings file and overrides some values for my development environment. Whenever I try to run ./manage.py runserver, it insists on using the settings.py on the same path as

Re: *Immediate* session expiration problem/bug in IE

2010-07-04 Thread ShawnMilo
I have an update. It turns out that setting the timeout in set_expiry to a much larger value prevents the immediate timeout. Of course, this means that people in well-behaved browsers won't time out when they should. This is despite the fact that I've tried sending both an integer (for seconds) and

Re: Formatting datetimes - simple question

2010-04-06 Thread ShawnMilo
In your forms and modelforms, you can specify both the allowed input date formats and the display format. http://docs.djangoproject.com/en/1.1/ref/forms/fields/#datefield (see the input_format option) http://docs.djangoproject.com/en/1.1/ref/forms/widgets/ (see the 'format' option) As for col

Re: Catching User's First Log in

2010-04-05 Thread ShawnMilo
How about the last_login and date_joined fields in the User model? They're both set to the current date/time when the user is created. So, if the user's "first login" is when the account is created, you could check to see if they're less than a second apart. If the user is created automatically