diff options
Diffstat (limited to 'bpynotify_orm.py')
| -rw-r--r-- | bpynotify_orm.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/bpynotify_orm.py b/bpynotify_orm.py deleted file mode 100644 index 0540d0a..0000000 --- a/bpynotify_orm.py +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | |||
| 3 | import datetime | ||
| 4 | |||
| 5 | from sqlalchemy import schema, types | ||
| 6 | from sqlalchemy.orm import mapper | ||
| 7 | |||
| 8 | metadata = schema.MetaData() | ||
| 9 | |||
| 10 | notification_entry_table = schema.Table('notification_entries', metadata, | ||
| 11 | schema.Column('id', types.Integer, primary_key=True), | ||
| 12 | schema.Column('timestamp', types.DateTime), | ||
| 13 | schema.Column('message', types.Unicode(), default = u'Empty message'), | ||
| 14 | schema.Column('viewed', types.Boolean, default=False) | ||
| 15 | ) | ||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | class NotificationEntry(object): | ||
| 20 | |||
| 21 | def __init__(self, message): | ||
| 22 | |||
| 23 | self.timestamp = datetime.datetime.now() | ||
| 24 | self.message = message | ||
| 25 | |||
| 26 | |||
| 27 | def __repr__(self): | ||
| 28 | |||
| 29 | return message | ||
| 30 | |||
| 31 | |||
| 32 | mapper(NotificationEntry, notification_entry_table) | ||
