forms.py 504 B

1234567891011121314
  1. __package__ = 'archivebox.core'
  2. from django import forms
  3. from ..util import URL_REGEX
  4. CHOICES = (
  5. ('0', 'depth = 0 (archive just these URLs)'),
  6. ('1', 'depth = 1 (archive these URLs and all URLs one hop away)'),
  7. )
  8. class AddLinkForm(forms.Form):
  9. url = forms.RegexField(label="URLs (one per line)", regex=URL_REGEX, min_length='6', strip=True, widget=forms.Textarea, required=True)
  10. depth = forms.ChoiceField(label="Archive depth", choices=CHOICES, widget=forms.RadioSelect, initial='0')