Re: Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
It builds up on the things mentioned in the documentation for normal > forms.  Also, the documentation for ModelForm's save instance has > pretty explicit examples of creating form instances: > > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-sav... > > -- dz > > On T

Re: Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
gt; -- dz > > On Tue, Mar 24, 2009 at 3:11 PM, Theme Park Photo, LLC > > <swir...@gmail.com> wrote: > > > It has data! It was created from an existing instance...and all the > > fields have values > > > 'body': u'hello there', 'allow_comments': &

Re: Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
), 'score': -93L, 'categories': [1L], 'title': u'Hello', 'slug': u'hello-0', 'tags': u'hello'} On Mar 24, 12:06 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Tue, Mar 24, 2009 at 3:02 PM, Theme Park Photo, LLC > <swir...@gmail.com>wrote: > > &g

Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
Im trying to get code to edit an existing record in a table working. For some reason, form.is_valid is returning false (and I can't save it because there's no cleaned data). Even reduced to this (below) where I'm simply getting an existing "Post" object, creating a ModelForm, and validating it,

Re: Access logs?

2009-03-18 Thread Theme Park Photo, LLC
Thanks! Armed with that information, I went back and checked my configuration files and, sure enough, I was missing the CustomLog /var/log/apache2/access.log combined statement in the VirtualHost entry for the django application. --~--~-~--~~~---~--~~ You

Access logs?

2009-03-18 Thread Theme Park Photo, LLC
Is there an existing Django application that will log normal requests? There doesn't seem to be any mention of what seems like a large omission in the django documentation... Django requests don't show up in the usual access log. --~--~-~--~~~---~--~~ You

Re: get_absolute_url not working on deployed site; exact same code works on dev site

2009-03-16 Thread Theme Park Photo, LLC
I have a feeling this is related (but I'm still stuck!) Occasionally, when I start it up, I see this: The URLCONF in settings.py looks OK File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module =

get_absolute_url not working on deployed site; exact same code works on dev site

2009-03-16 Thread Theme Park Photo, LLC
I'm having problems with get_absolute_url not working. It works fine on my development site, but when I tried to deploy it, it fails, and I can't figure out why I'm using the "basic.blog" app >>> post = Post.objects.published() >>> p = post[0] >>> print p.get_absolute_url() Traceback (most

Re: ImproperlyConfigured: MySQLdb-1.2.1p2 or newer is required; you have 1.2.1 But I HAVE 1.2.2!

2009-03-16 Thread Theme Park Photo, LLC
nty-stick.com> wrote: > On Sun, 2009-03-15 at 21:08 -0700, Theme Park Photo, LLC wrote: > > I'm getting this message when trying to start Django (from mod_python) > > > (From my apache log) > > > [Sun Mar 15 22:07:28 2009] [error] [client 67.188.95.50] PythonHandler &

ImproperlyConfigured: MySQLdb-1.2.1p2 or newer is required; you have 1.2.1 But I HAVE 1.2.2!

2009-03-15 Thread Theme Park Photo, LLC
I'm getting this message when trying to start Django (from mod_python) (From my apache log) [Sun Mar 15 22:07:28 2009] [error] [client 67.188.95.50] PythonHandler django.core.handlers.modpython: ImproperlyConfigured: MySQLdb-1.2.1p2 or newer is required; you have 1.2.1 BUT! I have 1.2.2

DateTime field always inserted as 0000-00-00 00:00:00

2009-03-10 Thread Theme Park Photo, LLC
Folks: I'm stumped over this one. I have a model: class QuestionAsked(models.Model): user = models.ForeignKey(User) asked = models.ForeignKey(QuestionTable) date = models.DateTimeField() choice = models.CharField(max_length=1) correct =

Re: Django CMS and template tags (is it a problem with pagination mechanism?)

2009-02-22 Thread Theme Park Photo, LLC
No! It was the fact that you really need all the stuff that's on the sample template On Feb 22, 2:29 pm, Donn <donn.in...@gmail.com> wrote: > On Sunday, 22 February 2009 21:00:24 Theme Park Photo, LLC wrote: > > {% block content %} > > Hello > > {% end block %} &g

Django CMS and template tags (is it a problem with pagination mechanism?)

2009-02-22 Thread Theme Park Photo, LLC
I can't seem to get django-cms to work with template tags If I specify as my default template something like (stripped to bare essentials here) FOO {% block content %} {% endblock %} and enter in the body of my content for a page to be rendered with this template (in the admin tool) {% block

Re: Can't create a record with a Foreign Key: IntegrityError: (1048, "Column 'user_id' cannot be null")

2009-02-03 Thread Theme Park Photo, LLC
Ok! NOW I get it! You need to do a get to do a select by primary key u=User.objects.get(username="swirsky") For some reason I thought that you could get by primary key by just creating the object with the key specified... --~--~-~--~~~---~--~~ You received

Re: Can't create a record with a Foreign Key: IntegrityError: (1048, "Column 'user_id' cannot be null")

2009-02-03 Thread Theme Park Photo, LLC
Thanks! That was a little unintuitive because, of course, I was only trying to do a "SELECT" on u and an INSERT on R. Save seems like it would do something to u On Feb 2, 10:39 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Mon, 2009-02-02 at 22:22 -0800, Th

Can't create a record with a Foreign Key: IntegrityError: (1048, "Column 'user_id' cannot be null")

2009-02-02 Thread Theme Park Photo, LLC
I can't get anything with Foreign keys to work. I trimmed everything down to the simplest example: from django.db import models from django.contrib.auth.models import User class Ranking(models.Model): user = models.ForeignKey(User) score = models.IntegerField() def

Re: Can't get django comments to pick up alternate form

2009-01-24 Thread Theme Park Photo, LLC
> Do you have django.contrib.comments   > coming before your own app in INSTALLED_APPS, by any chance? Yes I did! Thanks for the hint. I put my own app first, and now it's finding it just fine! --~--~-~--~~~---~--~~ You received this message because you are

Re: Can't get django comments to pick up alternate form

2009-01-24 Thread Theme Park Photo, LLC
Also from reading the source, I don't see any mechanism by which it would pick up form.html from any other than the three directories enumerated there. Am I really supposed to edit and setup.py install the django framework to change the comments template? On Jan 24, 5:13 pm, "Theme Park

Can't get django comments to pick up alternate form

2009-01-24 Thread Theme Park Photo, LLC
The documentation for render_comment_form hints that you can override the default template by putting comments/form.html with your own form in your templates directory. No matter what I do, it won't pick up my alternate form. Is there anyway to see the actual directories django is checking for

Re: How do I pass along an extra parameter to a view?

2008-10-06 Thread Theme Park Photo, LLC
Well what do you know! Someone went through the exact same thing as I did and documented it here: http://mccormac.org/blog/2007/apr/04/dynamically-serving-static-content-django/ This was exactly what I was looking for. --~--~-~--~~~---~--~~ You received this

How do I pass along an extra parameter to a view?

2008-10-05 Thread Theme Park Photo, LLC
I'm just getting started in Django and I'm stuck. I have defined in settings a variable called STATIC_ROOT that contains the root URL where static assets are served. In development it's something like static.example.com.local and in production it would be static.example.com How do I pass this

Re: Is it possible to use Django + Postgresql on leopard?

2008-08-25 Thread Theme Park Photo, LLC
as found by psycopg's   > configure. It's called py25-psycopg2. > > Thanks! > > Jon Brisibnhttp://jbrisbin.com > > On Aug 23, 2008, at 1:08 PM, Theme Park Photo, LLC wrote: > > > > > I have been unable to get Django + Postgres to run on Leopard. > > > (

Is it possible to use Django + Postgresql on leopard?

2008-08-23 Thread Theme Park Photo, LLC
I have been unable to get Django + Postgres to run on Leopard. (Works fine on Windows and Linux. Personally, I find it much easier to get most open source stuff to run on Windows or Windows+Cygwin than on the Mac!) Anyway, the problem isn't Django, and it isn't Postgres. It's psycopg2! I can't