diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-12-16 17:09:14 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-12-16 17:09:14 +0100 |
commit | fe85f003f3adfb568c8b1a650035128c183a739d (patch) | |
tree | 3abde88d3554831e0a41e3fd2d5d4092fd677a1f /module/web/pyload/models.py | |
parent | re-added progressbar (diff) | |
download | pyload-fe85f003f3adfb568c8b1a650035128c183a739d.tar.xz |
some Webinterface Json Code
Diffstat (limited to 'module/web/pyload/models.py')
-rw-r--r-- | module/web/pyload/models.py | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/module/web/pyload/models.py b/module/web/pyload/models.py index 293c01109..d3d99febc 100644 --- a/module/web/pyload/models.py +++ b/module/web/pyload/models.py @@ -1,21 +1,15 @@ # -*- coding: utf-8 -*- from django.db import models -#from django.contrib.auth.models.User import User as UserProfile +from django.contrib.auth.models import User # Create your models here. - -class Perm(models.Model): - """ extended pyLoad user Profile """ - - #user = models.ForeignKey(UserProfile, unique=True) - #template = models.CharField(maxlength=30) +class UserProfile(models.Model): + """ Permissions setting """ - class Meta: - permissions = ( - ("can_see_dl", "Can see Downloads"), - ("can_add", "Can add Downloads"), - ("can_delete", "Can delete Downloads"), - ("can_download", "Can download Files"), - ("can_see_logs", "Can see logs"), - ("can_change_status", "Can change status"), - )
\ No newline at end of file + user = models.ForeignKey(User, unique=True) + template = models.CharField(max_length=30, default='default', null=False, blank=False) + +def user_post_save(sender, instance, **kwargs): + profile, new = UserProfile.objects.get_or_create(user=instance) + +models.signals.post_save.connect(user_post_save, User)
\ No newline at end of file |