2019-06-03 14:59:18 +00:00
|
|
|
'''
|
|
|
|
Custom forms/formfields for the Save Point Radio project.
|
|
|
|
'''
|
|
|
|
|
|
|
|
from django.forms.fields import URLField
|
|
|
|
|
2019-06-06 19:45:56 +00:00
|
|
|
from core.validators import RadioIRIValidator
|
2019-06-03 14:59:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RadioIRIFormField(URLField):
|
|
|
|
'''
|
|
|
|
A custom URL form field that allows schemes that match those from
|
|
|
|
Liquidsoap. This is necessary due to a bug in how Django currently
|
|
|
|
handles custom URLFields:
|
|
|
|
|
|
|
|
https://code.djangoproject.com/ticket/25594
|
|
|
|
https://stackoverflow.com/questions/41756572/
|
|
|
|
'''
|
2019-06-03 18:41:23 +00:00
|
|
|
|
2019-06-06 19:45:56 +00:00
|
|
|
default_validators = [RadioIRIValidator()]
|