Hi,

I have a very annoyning problem with TurboGears and SQLObject. I've
defined some tables in my "model.py" file, but when I try to create the
database ("tg-admin sql create"), it complains about inexistent
relations. The thing that bothers me is that this problem dissapears
when I change the name of one of my classes, to all-lowercases. The
names for the other classes works just fine.

this is a extract of my "model.py" file, with my additions to it. I'm
using TG 0.9a6, and I'm using the identity feature. Check the class
"CIta". When named that way, and I try to create the database, it fails
with a message similar to "psycopg2.ProgrammingError: relation
"usuario" does not exist". And when I rename the class "Cita" to
"cita", tha database creation works fine. Any help would be appreciated

err, I'm using postgres, the latest version

%%%%%%%%%%%%%% %< %%%%%%%%%%%%%%%%
from datetime import datetime

from sqlobject import *

from turbogears import identity
from turbogears.database import PackageHub

from siterapias.tiposdedato import Telefono
from siterapias.tiposdedato import Identificacion

hub = PackageHub("siterapias")
__connection__ = hub


#definicion basica de usuario del laboratorio (paciente)
class Usuario(SQLObject):
  nombres=StringCol(length=20,notNone=True)
  apellidos=StringCol(length=20,notNone=True)
  telefono=StringCol(length=15,notNone=True)

#tablas para la definicion de especialista (profesional)
class Especialidad(SQLObject):
  nombre=StringCol(alternateID=True)

class Profesional(SQLObject):
  nombres=StringCol(length=20,notNone=True)
  apellidos=StringCol(length=20,notNone=True)
  especialidad=ForeignKey('Especialidad')
  identificacion=StringCol(alternateID=True,length=12)
  telefono=StringCol(length=15)


#definiciones para citas
class TipoCita(SQLObject):
  tipo=StringCol(length=100,notNone=True)

class Cita(SQLObject):
  fechaSolicitud=DateCol(notNone=True)
  usuario=ForeignKey('Usuario')
  fechaCita=DateTimeCol(notNone=True)
  tipo=ForeignKey('TipoCita')
  motivo=StringCol()
  profesional=ForeignKey('Profesional')
  observaciones=StringCol()

%%%%%%%%%%%%%% %< %%%%%%%%%%%%%%%%


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to