Package turbogears :: Package i18n :: Package sagettext :: Module model

Source Code for Module turbogears.i18n.sagettext.model

 1  from datetime import datetime 
 2   
 3  from sqlalchemy import (Table, Column, ForeignKey, 
 4      String, Unicode, Integer, DateTime) 
 5  from sqlalchemy.orm import relation, mapper 
 6   
 7  from turbogears.database import metadata 
 8   
 9   
10  tg_domain_table = Table('tg_i18n_domain', metadata, 
11      Column('id', Integer, primary_key=True), 
12      Column('name', Unicode, unique=True)) 
13   
14  tg_message_table = Table('tg_i18n_message', metadata, 
15      Column('id', Integer, primary_key=True), 
16      Column('name', Unicode), 
17      Column('text', Unicode, default=u""), 
18      Column('domain_id', Integer, ForeignKey(tg_domain_table.c.id)), 
19      Column('locale', String(length=15)), 
20      Column('created', DateTime, default=datetime.now), 
21      Column('updated', DateTime, default=None)) 
22   
23   
24 -class TG_Domain(object):
25 pass
26 27
28 -class TG_Message(object):
29 pass
30 31 32 mapper(TG_Domain, tg_domain_table, 33 properties=dict( 34 messages=relation( 35 TG_Message, backref='domain') 36 )) 37 38 mapper(TG_Message, tg_message_table, 39 properties=dict()) 40