#3607: db_columns problems
---------------------------+------------------------------------------------
Reporter: Mario Gonzalez | Owner: adrian
Status: new | Component: Database wrapper
Version: SVN | Keywords:
Stage: Unreviewed | Has_patch: 0
---------------------------+------------------------------------------------
*My backend is PostgreSQL*
In my models.py file I've got a class called
"Respuesta_satisfaccion_general" (30 chars) and the PK is defined by a
db_column attr: db_column=id_respuesta_satisfaccion_general (33 chars).
So the sequence name is going to be
"otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq",
it's a long string: 63 characters. Bad news, it fails: "relation doesn't
exists". A very little snipet:
{{{
class Respuesta_satisfaccion_general(models.Model):
id_respuesta_satisfaccion_general=
models.AutoField(primary_key=True,
db_column="id_respuesta_satisfaccion_general")
[...]
}}}
I first place I thougth it was a django problem, '''however''' I tested
on psql
{{{
SELECT currval("
otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq
");
NOTICE: el identificador «
otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq
» se truncará a «
otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_»
ERROR: no existe la columna «
otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_»
NOTICE translation:
"otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq"
will be truncated to
"otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_"
}}}
So, I think must be a validation before create tables, well before
generate SQL code. How did a "fixed"? I changed db_column content to
something shorter.
--
Ticket URL: <http://code.djangoproject.org/ticket/3607>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---