diff options
| author | Simeon Simeonov | 2014-05-07 22:28:48 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2014-05-07 22:28:48 +0200 |
| commit | 60f47b04174d016cc86c6e06fdaf0794c3d14216 (patch) | |
| tree | b8137a37b8e4b81202db5943b509652c7f9564b5 /bpynotify_orm.py | |
| parent | 833ddeb822493f6ab2abd6f193b4c0bc8ea76854 (diff) | |
Git server / generic client and weechat client completed
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) | ||
