Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a UserInfo model complete with timezone_id and timezone
Signed-off-by: Sean Chittenden <sean@chittenden.org>
  • Loading branch information
sean- committed Jun 10, 2011
1 parent e9ef370 commit 4a148f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion skeleton/modules/aaa/models/__init__.py
@@ -1,3 +1,4 @@
from .user import User
from .email import Email
from .user import User
from .user_emails import UserEmails
from .user_info import UserInfo
10 changes: 10 additions & 0 deletions skeleton/modules/aaa/models/user_info.py
@@ -0,0 +1,10 @@
from skeleton import db

class UserInfo(db.Model):
timezone_id = db.Column(db.Integer, db.ForeignKey('public.timezone.id'))
timezone = db.relationship('Timezone', primaryjoin='Timezone.id==UserInfo.timezone_id')

user_id = db.Column(db.Integer, primary_key=True)

__tablename__ = 'user_info'
__table_args__ = {'schema':'aaa'}
2 changes: 1 addition & 1 deletion sql/initialize/210_tables.sql
Expand Up @@ -12,7 +12,7 @@ CREATE TABLE public.timezone (
-- A table housing user-related information where there is no-harm if "a
-- SELECT *'s worth of information" is accessed or updated by a web user.
CREATE TABLE aaa.user_info (
id INT NOT NULL,
user_id INT NOT NULL,
timezone_id INT
);

Expand Down

0 comments on commit 4a148f3

Please sign in to comment.