Re: IntegrityErrors after Postgres database restore attempt

2009-12-31 Thread Felipe Reyes
Hi

2009/12/31 Jason :

> The big problem now, as you can see from the above error, is that if I
> try to add a new app, it squawks presumably because it's trying to
> assign an already existing pkey to django_content_type.  The
> sequencereset command looked promising, but that applies to apps
> only-- resetting the django_content_type table is what I guess I need
> to do...?

You should check the current value for the sequences, and update them
to highest value used on your table
http://www.postgresql.org/docs/current/interactive/functions-sequence.html

Probably the next value in the sequence is X, but X is already being
used by some row, so that violates the primary key.

Regards,

--

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.




how to exclude DateTime that are None

2009-11-02 Thread Felipe Reyes

Hi everybody,

I'm using django 0.96, one of my models has a DateTimeField, I'm
trying to exclude the from the queryset the rows that have null in the
datetimefield, I'm using something like this:

MyObject.objects.exclude(somedatecol=None)

that line gave me the following error

DataError: invalid input syntax for type timestamp with time zone: "None"


does somebody have some clue?

the database engine is a postgresql 8.3 using psycopg2 connector

thanks in advance

regards,

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---