2022-09-01 06:46:31 +00:00
|
|
|
from assets.models import Web
|
|
|
|
from .common import AssetSerializer
|
|
|
|
|
|
|
|
__all__ = ['WebSerializer']
|
|
|
|
|
|
|
|
|
|
|
|
class WebSerializer(AssetSerializer):
|
|
|
|
class Meta(AssetSerializer.Meta):
|
|
|
|
model = Web
|
2022-09-09 11:17:25 +00:00
|
|
|
fields = AssetSerializer.Meta.fields + [
|
2022-09-21 03:17:14 +00:00
|
|
|
'autofill', 'username_selector',
|
2022-10-20 08:39:11 +00:00
|
|
|
'password_selector', 'submit_selector',
|
|
|
|
'script'
|
2022-09-09 11:17:25 +00:00
|
|
|
]
|
2022-09-21 03:17:14 +00:00
|
|
|
extra_kwargs = {
|
|
|
|
**AssetSerializer.Meta.extra_kwargs,
|
|
|
|
'address': {
|
|
|
|
'label': 'URL'
|
2022-10-19 06:56:27 +00:00
|
|
|
},
|
|
|
|
'username_selector': {
|
2022-12-14 09:19:35 +00:00
|
|
|
'default': 'name=username'
|
2022-10-19 06:56:27 +00:00
|
|
|
},
|
|
|
|
'password_selector': {
|
2022-12-14 09:19:35 +00:00
|
|
|
'default': 'name=password'
|
2022-10-19 06:56:27 +00:00
|
|
|
},
|
|
|
|
'submit_selector': {
|
2022-12-14 09:19:35 +00:00
|
|
|
'default': 'id=longin_button',
|
2022-10-20 08:39:11 +00:00
|
|
|
},
|
2022-09-21 03:17:14 +00:00
|
|
|
}
|