from django import forms from .models import Subscription class AddFeedForm(forms.Form): feed_url = forms.URLField(label="Feed URL", max_length=1000, assume_scheme="https") tag_names = forms.CharField( label="Tags", max_length=500, required=False, help_text="Comma-separated. Leave blank to tag it later.", ) class EditSubscriptionForm(forms.ModelForm): class Meta: model = Subscription fields = ["custom_title"] labels = {"custom_title": "Title (leave blank to use the feed's own title)"} def __init__(self, *args, user=None, **kwargs): super().__init__(*args, **kwargs) self._user = user class OPMLImportForm(forms.Form): opml_file = forms.FileField(label="OPML file")