<s> from django import forms <EOL> from app . libs . utils import make_api_key <EOL> class ApiForm ( forms . Form ) : <EOL> client = forms . RegexField ( '<STR_LIT>' ) <EOL> key = forms . CharField ( ) <EOL> version = forms . RegexField ( '<STR_LIT>' ) <EOL> def clean_key ( self ) : <EOL> client = self . cleaned_data [ '<STR_LIT>' ] <EOL> key = self . cleaned_data [ '<STR_LIT:key>' ] <EOL> calced_key = make_api_key ( client ) <EOL> if key != calced_key : <EOL> raise forms . ValidationError ( u"<STR_LIT>" ) <EOL> return key <EOL> class RecentAppForm ( ApiForm ) : <EOL> offset = forms . IntegerField ( <EOL> min_value = <NUM_LIT:0> , <EOL> max_value = <NUM_LIT:1000> , <EOL> initial = <NUM_LIT:0> , <EOL> required = False , <EOL> ) <EOL> count = forms . IntegerField ( <EOL> min_value = <NUM_LIT:1> , <EOL> max_value = <NUM_LIT:50> , <EOL> initial = <NUM_LIT:10> , <EOL> required = False , <EOL> ) <EOL> platform = forms . IntegerField ( required = True ) <EOL> def clean_platform ( self ) : <EOL> platform = self . cleaned_data [ '<STR_LIT>' ] <EOL> if platform == <NUM_LIT:0> : <EOL> raise forms . ValidationError ( u"<STR_LIT>" ) <EOL> return platform <EOL> class DetailAppForm ( ApiForm ) : <EOL> pass <EOL> class callbackform ( forms . Form ) : <EOL> callback = forms . RegexField ( '<STR_LIT>' ) </s>
