django-orchestra/orchestra/apps/saas/services/bscw.py

31 lines
1,000 B
Python
Raw Normal View History

2014-09-26 19:21:09 +00:00
from django import forms
2014-11-09 10:16:07 +00:00
from django.core.exceptions import ValidationError
2014-09-26 19:21:09 +00:00
from django.utils.translation import ugettext_lazy as _
2014-11-09 10:16:07 +00:00
from rest_framework import serializers
2014-09-26 19:21:09 +00:00
2015-03-23 15:36:51 +00:00
from .. import settings
2014-11-20 15:34:59 +00:00
from .options import SoftwareService, SoftwareServiceForm
2014-09-26 19:21:09 +00:00
2014-09-28 12:28:57 +00:00
2014-11-09 10:16:07 +00:00
# TODO monitor quota since out of sync?
2014-11-20 15:34:59 +00:00
class BSCWForm(SoftwareServiceForm):
email = forms.EmailField(label=_("Email"), widget=forms.TextInput(attrs={'size':'40'}))
2014-11-09 10:16:07 +00:00
quota = forms.IntegerField(label=_("Quota"), help_text=_("Disk quota in MB."))
2014-11-20 15:34:59 +00:00
class BSCWDataSerializer(serializers.Serializer):
2014-11-09 10:16:07 +00:00
email = serializers.EmailField(label=_("Email"))
quota = serializers.IntegerField(label=_("Quota"), help_text=_("Disk quota in MB."))
2014-09-26 19:21:09 +00:00
class BSCWService(SoftwareService):
2015-03-23 15:36:51 +00:00
name = 'bscw'
2014-09-26 19:21:09 +00:00
verbose_name = "BSCW"
form = BSCWForm
2014-11-20 15:34:59 +00:00
serializer = BSCWDataSerializer
2015-03-04 21:06:16 +00:00
icon = 'orchestra/icons/apps/BSCW.png'
2014-11-20 15:34:59 +00:00
# TODO override from settings
2015-03-23 15:36:51 +00:00
site_name = settings.SAAS_BSCW_DOMAIN
2014-11-20 15:34:59 +00:00
change_readonly_fileds = ('email',)