summaryrefslogtreecommitdiffstats
path: root/core/module/web/pyload/models.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-08-25 16:48:55 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-08-25 16:48:55 +0200
commit3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea (patch)
treec5b2b1bfeb7eb8df2b97be118f6cbcec4e29cb3b /core/module/web/pyload/models.py
parentul.to fetching, so.biz expire (diff)
downloadpyload-3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea.tar.xz
merged gui
Diffstat (limited to 'core/module/web/pyload/models.py')
-rw-r--r--core/module/web/pyload/models.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/core/module/web/pyload/models.py b/core/module/web/pyload/models.py
new file mode 100644
index 000000000..86962f23c
--- /dev/null
+++ b/core/module/web/pyload/models.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+from django.db import models
+from django.contrib.auth.models import User
+# Create your models here.
+
+class Prefs(models.Model):
+ """ Permissions setting """
+
+ user = models.ForeignKey(User, unique=True)
+ template = models.CharField(max_length=30, default='default', null=False, blank=False) #@TODO: currently unused
+
+ class Meta:
+ permissions = (
+ ('can_see_dl', 'User can see Downloads'),
+ ('can_change_status', 'User can change Status'),
+ ('can_download', 'User can download'),
+ ('can_add', 'User can add Links'),
+ ('can_delete', 'User can delete Links'),
+ ('can_see_logs', 'User can see Logs'),
+ )
+ verbose_name = "Preferences"
+ verbose_name_plural = "Preferences"
+
+ def __unicode__(self):
+ return "Preferences for %s" % self.user
+
+
+def user_post_save(sender, instance, **kwargs):
+ profile, new = Prefs.objects.get_or_create(user=instance)
+
+models.signals.post_save.connect(user_post_save, User) \ No newline at end of file