Django ValidationError for DateField

2010-05-05 Thread LeeRisq
This is mostly me just venting, but why is it if you run a query like
this:

a = Model.objects.get(pk=1)

Which has an attribute with an output of:

a.date = None

I pass that to a template, change some other attribute and then
attempt to pass it back in:

date = request.GET['a.date']
b = Model.object.get(date=date)

And I get a ValidationError stating that I must enter a date in a
valid format. sigh
Shouldn't the output validate as input? Unless someone knows of a good
reason for this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Development to deployment

2009-11-18 Thread LeeRisq
I am working on a web site in a windows development environment, but
the hosting plan that my client is currently using runs a Linux
server. Can anyone tell me if there are significant hardships in
making this transition between Windows development vs. Linux
deployment. Thanks for reading.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Can't find doc for this - concerning buildout

2009-08-12 Thread LeeRisq

Hi all,

I just want to install buildout for use with my Django app, but I get
an error that I can't find any documentation for.

Here is what I am running:

C:\somedirectory>easy_install zc.buildout

This is what happens:

Searching for zc.buildout
Reading http://pypi.python.org/simple/zc.buildout/
No local packages or download links found for zc.buildout
error: Could not find a suitable distribution for Requirement.parse
('zc.buildout')

I've also tried installing virtualenv the same way and got the same
error. I apologize that it is not directly related to Django, but I
don't want to waste more time looking for an answer to what is
probably obvious to someone else. Thanks for reading.

Lee
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Intermediate Table question

2009-08-04 Thread LeeRisq

> I don't believe it would work, but even if it did, what would this do?
>  What's the expecected behavior?


class A defines an consumer order

class B and C both define different lines of product

I'd like to store all the ordering info in one intermediate table
while maintaining different tables for the porducts

Lee
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Intermediate Table question

2009-08-04 Thread LeeRisq

Does anyone know if an intermediate table can be specified on more
than two models? For instance:

class A(m.Model):
   B = ManyToManyField(B, through='D')
   C = ManyToManyField(C, through='D')

Will this validate and actually work?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Base Class Inheritance w/ Model Methods

2009-07-15 Thread LeeRisq

So I'm hitting a beginner's snag here. I have six models that I need
to contain essentially all the same attributes. I created a base class
and then created the child classes respectively. Some of the child
classes will contain additional attributes to the base class, but the
rest only need what is defined within the base class.

Is there a required minimum number of attributes that a child class
must have to validate? For instance, can the child class have zero
attributes because it inherits all of them from the base class?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Model Inheritance question

2009-06-25 Thread LeeRisq

If I am looking to use an abstract base class with multiple models,
which is assigned the primary key id? The child or the parent?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Modifying Django's User Model

2009-06-15 Thread LeeRisq

Thanks for the info. I'll check it out.

On Jun 12, 11:06 am, Rajesh D <rajesh.dha...@gmail.com> wrote:
> On Jun 12, 9:29 am, LeeRisq <leer...@gmail.com> wrote:
>
> > I am interested in changing the primary key of the User model to email
> > and also use that as the username.
>
> > I would like to maintain the admin interface as well.
>
> > I am uncertain about the ramifications of doing this. I understand
> > this change will need to be reflected in other models and some views,
> > but does anyone know just how deep this change would need to go?
>
> If you're mainly interested in making the email field unique (rather
> than a PK), you could use a custom user-creation form of your own. In
> your form, ensure that the clean_email method rejects duplicate
> emails. If you create users through admin, unregister the built-in
> UserAdmin class and reregister your own UserAdmin class that uses your
> custom user-creation form.
>
> If you want to allow login by email instead of by username, here's a
> starting point:
>
> http://www.djangosnippets.org/snippets/74/
>
> -Rajesh D
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Modifying Django's User Model

2009-06-12 Thread LeeRisq

I am interested in changing the primary key of the User model to email
and also use that as the username.

I would like to maintain the admin interface as well.

I am uncertain about the ramifications of doing this. I understand
this change will need to be reflected in other models and some views,
but does anyone know just how deep this change would need to go?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



ManyToMany Question

2009-06-11 Thread LeeRisq

Programming with Django is unfortunately my job on the side right now,
so limited time for coding and testing. I know I could answer this
question myself by tinkering around, but don't have time.

When you have a generic ManyToMany field specified between two models,
will Django automatically create a "through" table if I don't
explicitly tell it to? Logic tells me that it does, but the
documentation suggests otherwise unless I am losing it, which has been
known to happen. Thanks everyone.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



DjangoBook help Chapter 7

2009-04-17 Thread LeeRisq

Hey all,

Thanks for reading. I have gone over and over the section first half
of the chapter about having a simple search form. Here are my views:

from django.shortcuts import render_to_response
from mysite.books.models import Book

def search_form(request):
return render_to_response('search_form.html')

def search(request):
errors = []
if 'q' in request.GET:
q = request.GET['q']
if not q:
errors.append('Enter a search term.')
elif len(q) > 20:
errors.append('Please enter at most 20 characters,
dumbass.')
else:
books = Book.objects.filter(title_icontains=q)
return render_to_response('search_results.html',
{'books': books, 'query': q})
return render_to_response('search_form.html', {'errors': errors})

The error part of the view works fine, but when I get to the 'else'
clause I always get this error:

cannot resolve keyword 'title_icontains' into field. Choices are:
authors, id, publication_date, publisher, title

Can anyone enlighten me. I'm new to programming, so I'm sure it's just
a stupid mistake, but I can't see it. Thanks.

~Lee


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



OperationError: fe_sendauth: no password supplied

2009-04-08 Thread LeeRisq

I've been following along with the Djangobook. When I try to configure
the postgresql db, I get that error. I've tried tracing the problem
myself and have been unsuccessful.

>From Chapter 5:

>>> from django.db import connection
>>> cursor = connection.cursor()

Then I get the error. Any ideas?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---