Re: mod_python error (help please)

2005-10-08 Thread Abe

Maniac,
Thanks for your quick response and the reference.

I looked into the symlinking going on...  I'm not entirely sure what
the root cause was, but I deleted the symlink, copied the files to the
...site-packages directory and viola! everything is cool.

Cheers,
Abe



Re: meta.OneToOneField() problemo

2005-10-08 Thread Adrian Holovaty

On 9/19/05, Ian Maurer <[EMAIL PROTECTED]> wrote:
> First, I ran into an issue with runtests.py since I use MySQL. The DB
> connection autocommit requires an integer value and the current code
> throws a TypeError for me. So the real brain-dead way around this was:

Hey Ian,

Turns out the other database wrappers (Postgres and SQLite) don't mind
if you pass an integer value to autocommit(), so I've added that to
the code in revision 805. Thanks again for the heads-up on this!

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org


Re: Shopping cart paradigm in Django?

2005-10-08 Thread Adrian Holovaty

On 10/8/05, Fried Egg <[EMAIL PROTECTED]> wrote:
> Is there some documentation that describes creating an application with
> more state than a simple poll?
>
> I think a shopping cart would be the typical application; we are
> interested in assembling a statistical index based on a lot of data and
> user interaction before getting the final end result, with the chance
> to back out and redo, etc.

Hey Fried Egg,

Check out the sessions documentation:

http://www.djangoproject.com/documentation/sessions/

We should have some other example apps (besides the poll tutorial) soon.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org


Re: Can a field's validator access the request object?

2005-10-08 Thread Adrian Holovaty

On 10/7/05, Jason Huggins <[EMAIL PROTECTED]> wrote:
> By default, it looks like validators in Django are only given the new
> field's value and the posted form data... I have a custom validator for
> my model that depends on information only available in the request. How
> can I get to the request object from inside the validator?

Correct: validators don't have access to request objects. Validators
are decoupled from the concept of HTTP requests. Adding a request
parameter to validators is *not* a good idea...

In your case, I'd explicitly pass the request-object's data to the
manipulator. Here's an example, playing off of the example from
http://www.djangoproject.com/documentation/forms/ :

manipulator = ContactFormManipulator()
if request.POST:
new_data = request.POST.copy()

# Manually pass IP address to new_data.
new_data['ip_address'] = request.META['REMOTE_ADDR']

errors = manipulator.get_validation_errors(new_data)
if not errors:
manipulator.do_html2python(new_data)

# Send e-mail using new_data here...

return HttpResponseRedirect("/contact/thankyou/")
else:
errors = new_data = {}

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org


Shopping cart paradigm in Django?

2005-10-08 Thread Fried Egg

Is there some documentation that describes creating an application with
more state than a simple poll?

I think a shopping cart would be the typical application; we are
interested in assembling a statistical index based on a lot of data and
user interaction before getting the final end result, with the chance
to back out and redo, etc. 

Thx



Django intro workshop in Madrid, Spain

2005-10-08 Thread rapto

A practical introduction to Django.

We will build a simple forum or todo list.

Where: Cielito lindo
c/ Santa Ana 6
Madrid
Metro Latina
When: 19-X-2005 18:30-20:00
Who: Marcos Sánchez Provencio



Re: mod_python error (help please)

2005-10-08 Thread Maniac


Abe wrote:


ImportError: No module named django
 

Looks like your Python installation doesn't see Django. Read this guide: 
http://www.djangoproject.com/documentation/install/


Near the end in 'Installing the development version' item 3 should help