SciPost Code Repository

Skip to content
Snippets Groups Projects
forms.py 877 B
Newer Older
Jean-Sébastien Caux's avatar
Jean-Sébastien Caux committed
__copyright__ = "Copyright 2016-2018, Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"


from django import forms

from ajax_select.fields import AutoCompleteSelectField

from .constants import TOPIC_RELATIONS_ASYM
Jean-Sébastien Caux's avatar
Jean-Sébastien Caux committed


class SelectTagForm(forms.Form):
    tag = AutoCompleteSelectField('tag_lookup', label='', help_text='')


class SelectTopicForm(forms.Form):
    topic = AutoCompleteSelectField('topic_lookup')


class SelectLinkedTopicForm(forms.Form):
    topic = AutoCompleteSelectField('linked_topic_lookup',
                                    label='Find a topic (click to see it) ', help_text='')
class AddRelationAsymForm(forms.Form):
    A = AutoCompleteSelectField('topic_lookup', label='', help_text='')
    relation = forms.ChoiceField(choices=TOPIC_RELATIONS_ASYM, label='')
    B = AutoCompleteSelectField('topic_lookup', label='', help_text='')