API-Manager/apimanager/consumers/forms.py
JianweiGao 8220547ecd Added pagination for the users list page
No longer load all users with "/users/all" to filter usernames and email
Load the all entitlements with the "/entitlements" api  instead of traversing all the users
Set default value for the call limits inputs
2018-10-01 16:23:22 +08:00

67 lines
1.5 KiB
Python

# -*- coding: utf-8 -*-
"""
Forms of consumers app
"""
from django import forms
class ApiConsumersForm(forms.Form):
consumer_id = forms.CharField(
widget=forms.HiddenInput(),
required=True,
)
per_minute_call_limit = forms.IntegerField(
label='per_minute_call_limit',
widget=forms.NumberInput(
attrs={
'class': 'form-control',
}
),
initial=-1,
required=False,
)
per_hour_call_limit = forms.IntegerField(
label='per_hour_call_limit',
widget=forms.NumberInput(
attrs={
'class': 'form-control',
}
),
initial=-1,
required=False,
)
per_day_call_limit = forms.IntegerField(
label='per_day_call_limit',
widget=forms.NumberInput(
attrs={
'class': 'form-control',
}
),
initial=-1,
required=False,
)
per_week_call_limit = forms.IntegerField(
label='per_week_call_limit',
widget=forms.NumberInput(
attrs={
'class': 'form-control',
}
),
initial=-1,
required=False,
)
per_month_call_limit = forms.IntegerField(
label='per_month_call_limit',
widget=forms.NumberInput(
attrs={
'class': 'form-control',
}
),
initial=-1,
required=False,
)