<commit_before>from django import forms

from crispy_forms.helper import FormHelper
from crispy_forms.bootstrap import FormActions, Div
from crispy_forms.layout import Layout, Field, HTML, Button, Submit, Reset

class UploadImageForm(forms.Form):
    helper = FormHelper()
    helper.form_tag = False
    helper.form_class = 'form-horizontal'
    helper.label_class = 'col-xs-3'
    helper.field_class = 'col-xs-9'

    title = forms.CharField(
        label = "Alt. Title",
        required = True,
        max_length=50,
    )

    image = forms.FileField(
        label = "Image",
        required = True,
    )

    resize = forms.IntegerField(
        label = "Resize to this width or height",
        initial = 1000,
        required = True,
    )

    helper.layout = Layout(
        Field('title'),
        Field('image'),
        Field('resize'),

        Div(
            FormActions(
                HTML('<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>'),
                Submit('save', 'Upload'),
            ),
            css_class="modal-footer"
        ),

    )
<commit_msg>Append 'px' to end of image upload form resize field<commit_after>from django import forms

from crispy_forms.helper import FormHelper
from crispy_forms.bootstrap import FormActions, Div, AppendedText
from crispy_forms.layout import Layout, Field, HTML, Button, Submit, Reset

class UploadImageForm(forms.Form):
    helper = FormHelper()
    helper.form_tag = False
    helper.form_class = 'form-horizontal'
    helper.label_class = 'col-xs-3'
    helper.field_class = 'col-xs-9'

    title = forms.CharField(
        label = "Alt. Title",
        required = True,
        max_length=50,
    )

    image = forms.FileField(
        label = "Image",
        required = True,
    )

    resize = forms.IntegerField(
        label = "Resize to this width or height",
        initial = 1000,
        required = True,
    )

    helper.layout = Layout(
        Field('title'),
        Field('image'),
        AppendedText('resize', 'px'),

        Div(
            FormActions(
                HTML('<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>'),
                Submit('save', 'Upload'),
            ),
            css_class="modal-footer"
        ),

    )

{'fraction_non_alphanumeric': 0.11561691113028473, 'fraction_numerical': 0.006902502157031924, 'mean_word_length': 2.238826815642458, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7434316', 'n_tokens_mistral': 686, 'n_tokens_neox': 654, 'n_words': 163}