MCPcopy
hub / github.com/ArchiveBox/ArchiveBox / AddLinkForm

Class AddLinkForm

archivebox/core/forms.py:26–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26class AddLinkForm(forms.Form):
27 url = forms.RegexField(label="URLs (one per line)", regex=URL_REGEX, min_length='6', strip=True, widget=forms.Textarea, required=True)
28 parser = forms.ChoiceField(label="URLs format", choices=[('auto', 'Auto-detect parser'), *PARSER_CHOICES], initial='auto')
29 tag = forms.CharField(label="Tags (comma separated tag1,tag2,tag3)", strip=True, required=False)
30 depth = forms.ChoiceField(label="Archive depth", choices=DEPTH_CHOICES, initial='0', widget=forms.RadioSelect(attrs={"class": "depth-selection"}))
31 archive_methods = forms.MultipleChoiceField(
32 label="Archive methods (select at least 1, otherwise all will be used by default)",
33 required=False,
34 widget=forms.SelectMultiple,
35 choices=ARCHIVE_METHODS,
36 )
37 # TODO: hook these up to the view and put them
38 # in a collapsible UI section labeled "Advanced"
39 #
40 # exclude_patterns = forms.CharField(
41 # label="Exclude patterns",
42 # min_length='1',
43 # required=False,
44 # initial=URL_DENYLIST,
45 # )
46 # timeout = forms.IntegerField(
47 # initial=TIMEOUT,
48 # )
49 # overwrite = forms.BooleanField(
50 # label="Overwrite any existing Snapshots",
51 # initial=False,
52 # )
53 # index_only = forms.BooleanField(
54 # label="Add URLs to index without Snapshotting",
55 # initial=False,
56 # )
57
58class TagWidgetMixin:
59 def format_value(self, value):

Callers 2

add_viewMethod · 0.90
form_validMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected