Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1063 (closed defect: invalid)

Opened 13 years ago

Last modified 12 years ago

Identity/Visit creates duplicate tables

Reported by: mgaiman Owned by: anonymous
Priority: normal Milestone:
Component: Identity Version: 0.9a6
Severity: normal Keywords:


When quick starting a new project using 0.9a8 several duplicate tables get created. These tables are visit and tg_visit, visit_identity and tg_visit_identity. The tg_ duplicates are only created after the first launch of the quick started project.

To fix:

  • in soprovider.py change class TG_VisitIdentity(SQLObject): to class TG_VisitIdentity(InheritableSQLObject):
  • in sovisit.py change class TG_Visit(SQLObject): to class TG_Visit(InheritableSQLObject): (and import InheritableSQLObject)
  • in the model.py quickstart template, add a sqlmeta table="tg_..." for both Visit and VisitIdentity?


illustration.diff Download (1.3 KB) - added by mgaiman 13 years ago.
patch for illustration

Change History

comment:1 Changed 13 years ago by godoy

I believe you have something old in your disk. Those classes were moved to model.py inside your project so that you can easily customize them.

Besides that, what database are you using that allows duplicate tables? I don't know any that does that...

comment:2 Changed 13 years ago by mgaiman

I don't think so. The tables are unique, they just do the same thing, ie, Turbogears creates both a tg_visit and visit and a tg_visit_identity and visit_identity tables, whereas it should only create just tg_visit and tg_visit_identity.

I've tested this will sqlite, mysql and postgres. This isn't a db specific thing.

Changed 13 years ago by mgaiman

patch for illustration

comment:3 Changed 13 years ago by jorge.vargas

  • Status changed from new to closed
  • Resolution set to invalid

ok I know what's happening here.

your using the code wrong.

the internal TG identity classes are still there for backward compatibility only. you should NOT extend them just create your own.

I'm closing this ticket if you feel this is not resolve please post your issue (with compleate example, on the mailing list)

Note: See TracTickets for help on using tickets.