Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial value to the form Field model #30

Open
quillcraftsman opened this issue Oct 24, 2023 · 0 comments
Open

Add initial value to the form Field model #30

quillcraftsman opened this issue Oct 24, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@quillcraftsman
Copy link
Owner

Is your feature request related to a problem? Please describe.
Frequently we use initial value in django model field. We can't test in now with Field model

Describe the solution you'd like

  • Add new parameter "initial" to the Field model
  • Add special assert to the TestCaseMixin
  • Add condition to the main assert assertTrueFrom

Describe alternatives you've considered

Additional context
This is the form example to test initial value:

class LoadTrainingDataForm(forms.Form):
    name = forms.CharField(max_length=128, widget=forms.TextInput(attrs={
        'class': 'form-control'
    }))
    excel_file = forms.FileField(max_length=128, widget=forms.FileInput(attrs={
        'class': 'form-control'
    }))
    sheet_name = forms.IntegerField(required=False, initial=0, widget=forms.NumberInput(attrs={
        'class': 'form-control'
    }))
@quillcraftsman quillcraftsman added the enhancement New feature or request label Oct 24, 2023
@quillcraftsman quillcraftsman added the good first issue Good for newcomers label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant