<s> from django . db import models <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from freenasUI import choices <EOL> from freenasUI . freeadmin . models import Model , UserField , GroupField , PathField <EOL> from freenasUI . freeadmin . models . fields import MultiSelectField <EOL> from freenasUI . middleware . notifier import notifier <EOL> from freenasUI . storage . models import Task <EOL> class CIFS_Share ( Model ) : <EOL> cifs_path = PathField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> ) <EOL> cifs_home = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> default = False , <EOL> ) <EOL> cifs_name = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT:Name>" ) <EOL> ) <EOL> cifs_comment = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> ) <EOL> cifs_default_permissions = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( '<STR_LIT>' ) , <EOL> default = True <EOL> ) <EOL> cifs_ro = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> default = False , <EOL> ) <EOL> cifs_browsable = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> default = True , <EOL> ) <EOL> cifs_recyclebin = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> default = False , <EOL> ) <EOL> cifs_showhiddenfiles = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> default = False , <EOL> ) <EOL> cifs_guestok = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) , <EOL> default = False , <EOL> ) <EOL> cifs_guestonly = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) , <EOL> default = False , <EOL> ) <EOL> cifs_hostsallow = models . TextField ( <EOL> blank = True , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> cifs_hostsdeny = models . TextField ( <EOL> blank = True , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> cifs_vfsobjects = MultiSelectField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> max_length = <NUM_LIT:255> , <EOL> blank = True , <EOL> default = '<STR_LIT>' , <EOL> choices = list ( choices . CIFS_VFS_OBJECTS ( ) ) <EOL> ) <EOL> cifs_storage_task = models . ForeignKey ( <EOL> Task , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> on_delete = models . SET_NULL , <EOL> blank = True , <EOL> null = True <EOL> ) <EOL> cifs_auxsmbconf = models . TextField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> help_text = _ ( "<STR_LIT>" ) <EOL> ) <EOL> def __unicode__ ( self ) : <EOL> return self . cifs_name <EOL> def delete ( self , * args , ** kwargs ) : <EOL> super ( CIFS_Share , self ) . delete ( * args , ** kwargs ) <EOL> notifier ( ) . reload ( "<STR_LIT>" ) <EOL> class Meta : <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> verbose_name_plural = _ ( "<STR_LIT>" ) <EOL> ordering = [ "<STR_LIT>" ] <EOL> class AFP_Share ( Model ) : <EOL> afp_path = PathField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> ) <EOL> afp_name = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT:Name>" ) , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> afp_comment = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True <EOL> ) <EOL> afp_allow = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> afp_deny = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> afp_ro = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> afp_rw = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> afp_timemachine = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> '<STR_LIT>' <EOL> ) , <EOL> default = False , <EOL> ) <EOL> afp_nodev = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) , <EOL> default = False , <EOL> ) <EOL> afp_nostat = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) , <EOL> default = False , <EOL> ) <EOL> afp_upriv = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( '<STR_LIT>' ) , <EOL> default = True , <EOL> ) <EOL> afp_fperm = models . CharField ( <EOL> max_length = <NUM_LIT:3> , <EOL> default = "<STR_LIT>" , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> ) <EOL> afp_dperm = models . CharField ( <EOL> max_length = <NUM_LIT:3> , <EOL> default = "<STR_LIT>" , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> ) <EOL> afp_umask = models . CharField ( <EOL> max_length = <NUM_LIT:3> , <EOL> default = "<STR_LIT>" , <EOL> blank = True , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> ) <EOL> afp_hostsallow = models . CharField ( <EOL> blank = True , <EOL> max_length = <NUM_LIT> , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> ) , <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> ) <EOL> afp_hostsdeny = models . CharField ( <EOL> blank = True , <EOL> max_length = <NUM_LIT> , <EOL> help_text = _ ( "<STR_LIT>" ) , <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> ) <EOL> def __unicode__ ( self ) : <EOL> return unicode ( self . afp_name ) <EOL> def delete ( self , * args , ** kwargs ) : <EOL> super ( AFP_Share , self ) . delete ( * args , ** kwargs ) <EOL> notifier ( ) . reload ( "<STR_LIT>" ) <EOL> class Meta : <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> verbose_name_plural = _ ( "<STR_LIT>" ) <EOL> ordering = [ "<STR_LIT>" ] <EOL> class NFS_Share ( Model ) : <EOL> nfs_comment = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> ) <EOL> nfs_network = models . TextField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> blank = True , <EOL> ) <EOL> nfs_hosts = models . TextField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> blank = True , <EOL> ) <EOL> nfs_alldirs = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) , <EOL> default = False , <EOL> ) <EOL> nfs_ro = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( '<STR_LIT>' ) , <EOL> default = False , <EOL> ) <EOL> nfs_quiet = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) , <EOL> default = False , <EOL> ) <EOL> nfs_maproot_user = UserField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> max_length = <NUM_LIT> , <EOL> blank = True , <EOL> null = True , <EOL> default = '<STR_LIT>' , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> nfs_maproot_group = GroupField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> max_length = <NUM_LIT> , <EOL> blank = True , <EOL> null = True , <EOL> default = '<STR_LIT>' , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> nfs_mapall_user = UserField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> max_length = <NUM_LIT> , <EOL> blank = True , <EOL> null = True , <EOL> default = '<STR_LIT>' , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> nfs_mapall_group = GroupField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> max_length = <NUM_LIT> , <EOL> blank = True , <EOL> null = True , <EOL> default = '<STR_LIT>' , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> nfs_security = MultiSelectField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> max_length = <NUM_LIT:200> , <EOL> blank = True , <EOL> choices = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) , <EOL> ) <EOL> def __unicode__ ( self ) : <EOL> if self . nfs_comment : <EOL> return unicode ( self . nfs_comment ) <EOL> return u"<STR_LIT>" % '<STR_LIT:U+002CU+0020>' . join ( [ p . path for p in self . paths . all ( ) ] ) <EOL> def delete ( self , * args , ** kwargs ) : <EOL> super ( NFS_Share , self ) . delete ( * args , ** kwargs ) <EOL> notifier ( ) . reload ( "<STR_LIT>" ) <EOL> @ property <EOL> def nfs_paths ( self ) : <EOL> return [ p . path for p in self . paths . all ( ) ] <EOL> class Meta : <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> verbose_name_plural = _ ( "<STR_LIT>" ) <EOL> class NFS_Share_Path ( Model ) : <EOL> share = models . ForeignKey ( NFS_Share , related_name = "<STR_LIT>" ) <EOL> path = PathField ( verbose_name = _ ( "<STR_LIT>" ) ) <EOL> def __unicode__ ( self ) : <EOL> return self . path <EOL> class Meta : <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> verbose_name_plural = _ ( "<STR_LIT>" ) <EOL> ordering = [ "<STR_LIT:path>" ] <EOL> class WebDAV_Share ( Model ) : <EOL> webdav_name = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> webdav_comment = models . CharField ( <EOL> max_length = <NUM_LIT> , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> blank = True , <EOL> ) <EOL> webdav_path = PathField ( <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> ) <EOL> webdav_ro = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( '<STR_LIT>' ) , <EOL> default = False , <EOL> ) <EOL> webdav_perm = models . BooleanField ( <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> help_text = _ ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> default = True , <EOL> ) <EOL> def __unicode__ ( self ) : <EOL> return self . webdav_name <EOL> def delete ( self , * args , ** kwargs ) : <EOL> super ( WebDAV_Share , self ) . delete ( * args , ** kwargs ) <EOL> notifier ( ) . reload ( "<STR_LIT>" ) <EOL> class Meta : <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> verbose_name_plural = _ ( "<STR_LIT>" ) <EOL> ordering = [ "<STR_LIT>" ] </s>
