Notification system

This commit is contained in:
Ruud committed 2012-03-14 20:33:22 +01:00
1 parent 2323136221
commit 15175a0330
25 files changed
+1313 -165

No files matched your search

+13 -3
View File
@@ -7,6 +7,7 @@ from libs.elixir.relationships import OneToOne
from sqlalchemy.types import Integer, Unicode, UnicodeText, Boolean, Float, \
String, TypeDecorator
import json
import time
options_defaults["shortnames"] = True
@@ -33,7 +34,7 @@ class Movie(Entity):
The files belonging to the movie object are global for the whole movie
such as trailers, nfo, thumbnails"""
last_edit = Field(Integer)
last_edit = Field(Integer, default = lambda: int(time.time()))
library = ManyToOne('Library')
status = ManyToOne('Status')
@@ -191,8 +192,8 @@ class History(Entity):
"""History of actions that are connected to a certain release,
such as, renamed to, downloaded, deleted, download subtitles etc"""
added = Field(Integer)
message = Field(UnicodeText())
added = Field(Integer, default = lambda: int(time.time()))
message = Field(UnicodeText)
type = Field(Unicode(50))
release = ManyToOne('Release')
@@ -207,6 +208,15 @@ class RenameHistory(Entity):
file = ManyToOne('File')
class Notification(Entity):
using_options(order_by = 'added')
added = Field(Integer, default = lambda: int(time.time()))
read = Field(Boolean, default = False)
message = Field(Unicode(255))
data = Field(JsonType)
class Folder(Entity):
"""Renamer destination folders."""