class LoggerFilterForm(FilterForm): def __init__(self, *args, **kwargs): super(LoggerFilterForm, self).__init__(*args, **kwargs) def _get_header_title(self): return _("Logged Actions") def get_key_time_field(self): return self.base_fields['TimeBegin'] default_fields_names = ['ServiceType', 'TimeBegin', 'IsMonitoring'] ServiceType = IntegerChoiceField(id="logger_service_type_id", label=_('Service type'), choices=CorbaLazyRequestIterStruct( 'Logger', None, 'getServices', ['id', 'name'], None), onchange="filter_action_types();") SourceIp = CharField(label=_('Source IP')) UserName = CharField(label=_('Username')) RequestType = IntegerChoiceField(id="logger_action_type_id", label=_('Request type'), choices=[], validate=False, onfocus="filter_action_types();") TimeBegin = DateTimeIntervalField(label=_('Begin time')) TimeEnd = DateTimeIntervalField(label=_('End time')) RequestPropertyValue = CompoundFilterField(label=_('Property'), form_class=PropertyFilterForm) ResultCode = CompoundFilterField(label=_('Result code'), form_class=ResultCodeFilterForm) IsMonitoring = BooleanField(label=_("Monitoring"))
class FilterFilterForm(FilterForm): default_fields_names = ['Type'] UserID = CharField(label=_('User name')) GroupID = CharField(label=_('Group name')) Type = ChoiceField(label=_('Result'), choices=[(1, u'Poraněn'), (2, u'Preživší'), (3, u'Mrtev'), (4, u'Nemrtvý')])
class PropertyFilterForm(FilterForm): default_fields_names = ['Name'] try: Name = ChoiceField(label=_('Name'), choices=get_property_list()) except Exception: Name = CharField(label=_('Name')) Value = CharField(label=_('Value')) OutputFlag = BooleanField(label=_('Output Flag'))
class NSSetFilterForm(ObjectFilterForm): TechContact = CompoundFilterField(label=_('Technical contact'), form_class=ContactFilterForm) HostIP = CharField(label=_('IP address')) HostFQDN = CharField(label=_('Nameserver name')) def clean(self): cleaned_data = super(NSSetFilterForm, self).clean() return cleaned_data
class FileFilterForm(FilterForm): default_fields_names = ['Type'] Name = CharField(label=_('Name')) Path = CharField(label=_('Path')) MimeType = CharField(label=_('Mime type')) CreateTime = DateTimeIntervalField(label=_('Create time')) Type = ChoiceField(label=_('Type'), choices=CorbaLazyRequestIterStruct( 'FileManager', None, 'getTypeEnum', ['id', 'name'], None))
class PublicRequestFilterForm(FilterForm): default_fields_names = ['Id'] Id = IntegerField(label=_('ID')) Type = CorbaEnumChoiceField(label=_('Type'), corba_enum=Registry.PublicRequest.Type) Status = CorbaEnumChoiceField(label=_('Status'), corba_enum=Registry.PublicRequest.Status) CreateTime = DateTimeIntervalField(label=_('Create time')) ResolveTime = DateTimeIntervalField(label=_('Resolve time')) Reason = CharField(label=_('Reason')) EmailToAnswer = CharField(label=_('Email to answer')) Object = CompoundFilterField(label=_('Object'), form_class=ObjectFilterForm)
class ObjectFilterForm(FilterForm): default_fields_names = ['Handle'] Handle = CharField(label=_('Handle')) AuthInfo = CharField(label=_('AuthInfo')) Registrar = CompoundFilterField(label=_('Registrar'), form_class=RegistrarFilterForm) CreateRegistrar = CompoundFilterField(label=_('Creation registrar'), form_class=RegistrarFilterForm) UpdateRegistrar = CompoundFilterField(label=_('Update registrar'), form_class=RegistrarFilterForm) CreateTime = DateTimeIntervalField(label=_('Registration date')) UpdateTime = DateTimeIntervalField(label=_('Update date')) TransferTime = DateTimeIntervalField(label=_('Transfer date')) DeleteTime = DateTimeIntervalField(label=_('Delete date')) ObjectState = CompoundFilterField(label=_('Object state'), form_class=ObjectStateFilterForm)
class MessageFilterForm(FilterForm): default_fields_names = ['CrDate'] CrDate = DateTimeIntervalField(label=_('Creation date')) ModDate = DateTimeIntervalField(label=_('Modification date')) Attempt = IntegerField(label=_('Attempts')) Status = ChoiceField(label=_('Status'), choices=CorbaLazyRequestIterStruct( 'Messages', None, 'getStatusList', ['id', 'name'], None)) CommType = ChoiceField(label=_('Communication type'), choices=CorbaLazyRequestIterStruct( 'Messages', None, 'getCommTypeList', ['id', 'name'], None)) MessageType = ChoiceField(label=_('Message type'), choices=CorbaLazyRequestIterStruct( 'Messages', None, 'getMessageTypeList', ['id', 'name'], None)) SmsPhoneNumber = CharField(label=_('SMS phone number')) LetterAddrName = CharField(label=_('Letter address name')) MessageContact = CompoundFilterField(label=_('Message contact'), form_class=ContactFilterForm)
class ContactFilterForm(ObjectFilterForm): default_fields_names = ObjectFilterForm.default_fields_names + ['Name'] Email = CharField(label=_('Email')) NotifyEmail = CharField(label=_('Notify email')) Name = CharField(label=_('Name')) Organization = CharField(label=_('Organization')) Ssn = CharField(label=_('Identification')) Vat = CharField(label=_('VAT')) PhoneNumber = CharField(label=_('Phone number'))
class InvoiceFilterForm(FilterForm): default_fields_names = ['Type'] Type = CorbaEnumChoiceField(label=_('Type'), corba_enum=Registry.Invoicing.InvoiceType) Number = CharField(label=_('Number')) CreateTime = DateTimeIntervalField(label=_('Create time')) TaxDate = DateIntervalField(label=_('Tax date')) Registrar = CompoundFilterField(label=_('Registrar'), form_class=RegistrarFilterForm) Object = CompoundFilterField(label=_('Object'), form_class=ObjectFilterForm) File = CompoundFilterField(label=_('File'), form_class=FileFilterForm)
class BankStatementFilterForm(FilterForm): def _get_header_title(self): return _("Payments") default_fields_names = ['Type'] Type = IntegerChoiceField( label=_('Type'), choices=[(editforms.PAYMENT_UNASSIGNED, editforms.payment_map[editforms.PAYMENT_UNASSIGNED]), (editforms.PAYMENT_REGISTRAR, editforms.payment_map[editforms.PAYMENT_REGISTRAR]), (editforms.PAYMENT_BANK, editforms.payment_map[editforms.PAYMENT_BANK]), (editforms.PAYMENT_ACCOUNTS, editforms.payment_map[editforms.PAYMENT_ACCOUNTS]), (editforms.PAYMENT_ACADEMIA, editforms.payment_map[editforms.PAYMENT_ACADEMIA]), (editforms.PAYMENT_OTHER, editforms.payment_map[editforms.PAYMENT_OTHER])]) AccountDate = DateIntervalField(label=_('Account date')) AccountNumber = CharField(label=_('Account number')) BankCode = CharField(label=_('Bank code')) ConstSymb = CharField(label=_('Constant symbol')) VarSymb = CharField(label=_('Variable symbol')) CrTime = DateTimeIntervalField(label=_('Import time')) AccountMemo = CharField(label=_('Memo')) AccountId = ChoiceField(label=_('Destination account'), choices=CorbaLazyRequestIterStruct( 'Admin', None, 'getBankAccounts', ['id', 'name'], None))
class MailFilterForm(FilterForm): default_fields_names = ['CreateTime', 'Type'] Type = ChoiceField(label=_('Type'), choices=CorbaLazyRequestIterStruct( 'Mailer', None, 'getMailTypes', ['id', 'name'], None)) #Handle = CharField(label=_('Handle')) CreateTime = DateTimeIntervalField(label=_('Create time')) ModifyTime = DateTimeIntervalField(label=_('Modify time')) # docasny, az bude v corba tak smazat Status = IntegerField(label=_('Status')) Attempt = IntegerField(label=_('Attempt')) Message = CharField(label=_('Message')) Attachment = CompoundFilterField(label=_('Attachment'), form_class=FileFilterForm) def get_key_time_field(self): return self.base_fields['CreateTime']
class RegistrarFilterForm(FilterForm): default_fields_names = ['Handle'] Handle = CharField(label=_('Handle')) Name = CharField(label=_('Name')) Organization = CharField(label=_('Organization')) City = CharField(label=_('City')) CountryCode = CharField(label=_('Country')) ZoneFqdn = CharField(label=_('Zone fqdn')) GroupId = ChoiceField( label=_('Group'), choices=CorbaLazyRequestIterStruct( 'Admin', 'getGroupManager', 'getGroups', ['id', 'name'], lambda groups: [g for g in groups if not g.cancelled]))
class ResultCodeFilterForm(FilterForm): default_fields_names = ['Name'] Name = CharField(label=_('Name')) ResultCode = IntegerField(label=_('Result Code')) ServiceId = IntegerField(label=_('ServiceId'))
class RequestObjectRefFilterForm(FilterForm): ObjectType = CharField(label=_('Type')) ObjectId = IntegerField(label=_('Id'))