-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathforms.py
More file actions
53 lines (45 loc) · 2.46 KB
/
Copy pathforms.py
File metadata and controls
53 lines (45 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, FloatField, SubmitField, HiddenField, BooleanField, SelectField
from wtforms.validators import DataRequired, URL, Optional, Length
class ProductForm(FlaskForm):
"""Form for adding or editing a product."""
title = StringField('Title', validators=[DataRequired(), Length(max=255)])
description = TextAreaField('Description', validators=[Optional()])
price = FloatField('Price', validators=[Optional()])
image_url = StringField('Image URL', validators=[Optional(), URL()])
submit = SubmitField('Save')
class EnvVarForm(FlaskForm):
"""Form for adding or editing environment variables."""
key = StringField('Key', validators=[DataRequired(), Length(max=255)])
value = StringField('Value', validators=[DataRequired()])
description = TextAreaField('Description', validators=[Optional()])
submit = SubmitField('Save')
class CollectionForm(FlaskForm):
"""Form for creating or editing a collection."""
name = StringField('Name', validators=[DataRequired(), Length(max=255)])
slug = StringField('Slug', validators=[Optional(), Length(max=255)])
description = TextAreaField('Description', validators=[Optional()])
meta_description = TextAreaField('Meta Description (for SEO)', validators=[Optional(), Length(max=160)])
tag_id = HiddenField('Tag ID')
submit = SubmitField('Save')
class TagForm(FlaskForm):
"""Form for adding a tag manually."""
name = StringField('Name', validators=[DataRequired(), Length(max=100)])
submit = SubmitField('Add Tag')
class AutoTagForm(FlaskForm):
"""Form for auto-tagging products."""
submit = SubmitField('Auto-Tag Selected Products')
class CreateCollectionsForm(FlaskForm):
"""Form for creating collections from tags."""
exclude_imported_tags = BooleanField('Only use tags generated by Claude (exclude imported tags)')
submit = SubmitField('Create Collections from Tags')
class StoreForm(FlaskForm):
"""Form for adding or editing a store."""
name = StringField('Store Name', validators=[DataRequired(), Length(max=255)])
url = StringField('Store URL', validators=[DataRequired(), Length(max=255)])
access_token = StringField('Access Token', validators=[Optional(), Length(max=255)])
submit = SubmitField('Save')
class StoreSelectForm(FlaskForm):
"""Form for selecting the current store."""
store_id = SelectField('Select Store', coerce=int)
submit = SubmitField('Switch Store')