<s> from django import forms <EOL> from django . contrib . auth . models import User <EOL> from django . forms import ModelForm <EOL> from django . forms . models import inlineformset_factory <EOL> from models import Project <EOL> from models import Dataset <EOL> from models import Token <EOL> from models import Channel <EOL> from models import Backup <EOL> class ProjectForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Project <EOL> exclude = ( '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def clean_project ( self ) : <EOL> if '<STR_LIT>' in self . cleaned_data : <EOL> project = self . cleaned_data [ '<STR_LIT>' ] <EOL> return project <EOL> raise forms . ValidationError ( '<STR_LIT>' ) <EOL> class DatasetForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Dataset <EOL> exclude = ( '<STR_LIT:user>' , ) <EOL> class TokenForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Token <EOL> exclude = ( '<STR_LIT:user>' , ) <EOL> def clean_token ( self ) : <EOL> if '<STR_LIT>' in self . cleaned_data : <EOL> token = self . cleaned_data [ '<STR_LIT>' ] <EOL> return token <EOL> raise forms . ValidationError ( '<STR_LIT>' ) <EOL> class ChannelForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Channel <EOL> exclude = ( '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def clean_channel ( self ) : <EOL> if '<STR_LIT>' in self . cleaned_data : <EOL> token = self . cleaned_data [ '<STR_LIT>' ] <EOL> return token <EOL> raise forms . ValidationError ( '<STR_LIT>' ) <EOL> class BackupForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Backup <EOL> exclude = ( '<STR_LIT>' , '<STR_LIT:status>' , '<STR_LIT>' , '<STR_LIT:filename>' , '<STR_LIT>' ) <EOL> class dataUserForm ( forms . Form ) : <EOL> firstname = forms . CharField ( max_length = <NUM_LIT:200> ) <EOL> lastname = forms . CharField ( max_length = <NUM_LIT:200> ) <EOL> email = forms . CharField ( max_length = <NUM_LIT> ) <EOL> token = forms . CharField ( max_length = <NUM_LIT:200> ) <EOL> resolution = forms . IntegerField ( ) <EOL> CHOICES = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> format = forms . ChoiceField ( choices = CHOICES ) <EOL> xmin = forms . IntegerField ( ) <EOL> xmax = forms . IntegerField ( ) <EOL> ymin = forms . IntegerField ( ) <EOL> ymax = forms . IntegerField ( ) <EOL> zmin = forms . IntegerField ( ) <EOL> zmax = forms . IntegerField ( ) </s>
