django-forms-frontend-validation 1.0.4__tar.gz → 1.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/MANIFEST.in +1 -1
  2. {django_forms_frontend_validation-1.0.4/django_forms_frontend_validation.egg-info → django_forms_frontend_validation-1.0.6}/PKG-INFO +45 -7
  3. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/README.md +45 -7
  4. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6/django_forms_frontend_validation.egg-info}/PKG-INFO +45 -7
  5. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/settings.py +1 -1
  6. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/setup.py +1 -1
  7. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/LICENSE +0 -0
  8. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/django_forms_frontend_validation.egg-info/SOURCES.txt +0 -0
  9. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/django_forms_frontend_validation.egg-info/dependency_links.txt +0 -0
  10. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/django_forms_frontend_validation.egg-info/requires.txt +0 -0
  11. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/django_forms_frontend_validation.egg-info/top_level.txt +0 -0
  12. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/__init__.py +0 -0
  13. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/admin.py +0 -0
  14. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/apps.py +0 -0
  15. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/form_utils/__init__.py +0 -0
  16. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/form_utils/form_utils.py +0 -0
  17. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/forms.py +0 -0
  18. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/migrations/__init__.py +0 -0
  19. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/models.py +0 -0
  20. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/static/dist/forms.bundle.js +0 -0
  21. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/static/webpack/package-lock.json +0 -0
  22. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/static/webpack/package.json +0 -0
  23. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/static/webpack/src/css/style.css +0 -0
  24. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/static/webpack/src/js/formFunctions.js +0 -0
  25. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/static/webpack/src/js/index.js +0 -0
  26. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/static/webpack/webpack.config.js +0 -0
  27. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/templates/base.html +0 -0
  28. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/templates/formvalidator/sample.html +0 -0
  29. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/templates/formvalidator/sample2.html +0 -0
  30. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/templates/includes/header.html +0 -0
  31. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/tests.py +0 -0
  32. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/urls.py +0 -0
  33. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/formvalidator/views.py +0 -0
  34. {django_forms_frontend_validation-1.0.4 → django_forms_frontend_validation-1.0.6}/setup.cfg +0 -0
@@ -7,4 +7,4 @@ recursive-include formvalidator/static/dist *
7
7
  recursive-include formvalidator/templates *
8
8
 
9
9
  # Exclude the node_modules directory
10
- prune formvalidator/static/webpack/node_modules
10
+ prune formvalidator/static/webpack *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-forms-frontend-validation
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: A Django app for front-end form validation
5
5
  Home-page: https://github.com/andrew-kyle92/django-forms-frontend-validation
6
6
  Author: Andrew Kyle
@@ -34,11 +34,13 @@ The application is designed to streamline the process of form validation, ensuri
34
34
  - Includes CSRF token management for secure AJAX-based form submissions.
35
35
 
36
36
  ## Usage
37
+ ### Installation
38
+ 1. Install the Django project
39
+ ```cmd
40
+ pip install django-frontend-forms-validation
41
+ ```
37
42
  ### Setting Up
38
- 1. Include Required Components:
39
- - Include the JavaScript files in your project to enable client-side functionality.
40
- - Ensure `form_utils.py` is imported and accessible in your Django app.
41
- 2. Define Settings in settings.py
43
+ 1. Define Settings in settings.py
42
44
  - Add `formvalidator` to installed apps.
43
45
  ```python
44
46
  INSTALLED_APPS = [
@@ -54,7 +56,7 @@ The application is designed to streamline the process of form validation, ensuri
54
56
  IGNORE_VALIDATION = ['example-ignore-validation', ...]
55
57
  VALIDATE_ONLY_ON_SUBMIT = ['all'] # Options: "__all__", specific class names, or leave empty.
56
58
  ```
57
- 3. Initial Forms:
59
+ 2. Initial Forms:
58
60
  - Ensure the `_InitializeForms` method is called during page load to attach validation logic to forms dynamically.
59
61
  To your HTML template with the form, add this.
60
62
  ```html
@@ -74,7 +76,7 @@ The application is designed to streamline the process of form validation, ensuri
74
76
  });
75
77
  </script>
76
78
  ```
77
- 4. Server-Side Context:
79
+ 3. Server-Side Context:
78
80
  - Use the `FormsValidator` class to pass configuration to templates:
79
81
  ```python
80
82
  from formvalidator.form_utils import FormsValidator
@@ -87,3 +89,39 @@ The application is designed to streamline the process of form validation, ensuri
87
89
  }
88
90
  return render(request, 'my_template.html', context)
89
91
  ```
92
+ 4. Add `div` Groups to the HTML Form:
93
+ - The JavaScript in this project relies on each form field being wrapped inside an outer div with the classname of ```form-group```.
94
+ - It helps set apart each input from other inputs within the form.
95
+ - Here is an example of the setup:
96
+ ```html
97
+ <form ...>
98
+ {% csrf_token %}
99
+
100
+ <div class="form-group">
101
+ <label for="field1">Field 1</label>
102
+ <input type="text" name="field1">
103
+ </div>
104
+
105
+ <div class="form-group">
106
+ <label for="field2">Field 1</label>
107
+ <input type="text" name="field2">
108
+ </div>
109
+
110
+ <-- Adding the rest of the form groups below -->
111
+ ...
112
+ </form>
113
+ ```
114
+ - If iterating through each form input using the ```form``` context variable:
115
+ ```html
116
+ <form ...>
117
+ {% csrf_token %}
118
+
119
+ <-- iterating through each form field -->
120
+ {% for field in form %}
121
+ <div class="form-group">
122
+ <label for="{{ field.name }}">{{ field.label }}</label>
123
+ {{ field }}
124
+ </div>
125
+ {% endfor %}
126
+ </form>
127
+ ```
@@ -19,11 +19,13 @@ The application is designed to streamline the process of form validation, ensuri
19
19
  - Includes CSRF token management for secure AJAX-based form submissions.
20
20
 
21
21
  ## Usage
22
+ ### Installation
23
+ 1. Install the Django project
24
+ ```cmd
25
+ pip install django-frontend-forms-validation
26
+ ```
22
27
  ### Setting Up
23
- 1. Include Required Components:
24
- - Include the JavaScript files in your project to enable client-side functionality.
25
- - Ensure `form_utils.py` is imported and accessible in your Django app.
26
- 2. Define Settings in settings.py
28
+ 1. Define Settings in settings.py
27
29
  - Add `formvalidator` to installed apps.
28
30
  ```python
29
31
  INSTALLED_APPS = [
@@ -39,7 +41,7 @@ The application is designed to streamline the process of form validation, ensuri
39
41
  IGNORE_VALIDATION = ['example-ignore-validation', ...]
40
42
  VALIDATE_ONLY_ON_SUBMIT = ['all'] # Options: "__all__", specific class names, or leave empty.
41
43
  ```
42
- 3. Initial Forms:
44
+ 2. Initial Forms:
43
45
  - Ensure the `_InitializeForms` method is called during page load to attach validation logic to forms dynamically.
44
46
  To your HTML template with the form, add this.
45
47
  ```html
@@ -59,7 +61,7 @@ The application is designed to streamline the process of form validation, ensuri
59
61
  });
60
62
  </script>
61
63
  ```
62
- 4. Server-Side Context:
64
+ 3. Server-Side Context:
63
65
  - Use the `FormsValidator` class to pass configuration to templates:
64
66
  ```python
65
67
  from formvalidator.form_utils import FormsValidator
@@ -71,4 +73,40 @@ The application is designed to streamline the process of form validation, ensuri
71
73
  'form_validator': form_validator.get_context(),
72
74
  }
73
75
  return render(request, 'my_template.html', context)
74
- ```
76
+ ```
77
+ 4. Add `div` Groups to the HTML Form:
78
+ - The JavaScript in this project relies on each form field being wrapped inside an outer div with the classname of ```form-group```.
79
+ - It helps set apart each input from other inputs within the form.
80
+ - Here is an example of the setup:
81
+ ```html
82
+ <form ...>
83
+ {% csrf_token %}
84
+
85
+ <div class="form-group">
86
+ <label for="field1">Field 1</label>
87
+ <input type="text" name="field1">
88
+ </div>
89
+
90
+ <div class="form-group">
91
+ <label for="field2">Field 1</label>
92
+ <input type="text" name="field2">
93
+ </div>
94
+
95
+ <-- Adding the rest of the form groups below -->
96
+ ...
97
+ </form>
98
+ ```
99
+ - If iterating through each form input using the ```form``` context variable:
100
+ ```html
101
+ <form ...>
102
+ {% csrf_token %}
103
+
104
+ <-- iterating through each form field -->
105
+ {% for field in form %}
106
+ <div class="form-group">
107
+ <label for="{{ field.name }}">{{ field.label }}</label>
108
+ {{ field }}
109
+ </div>
110
+ {% endfor %}
111
+ </form>
112
+ ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-forms-frontend-validation
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: A Django app for front-end form validation
5
5
  Home-page: https://github.com/andrew-kyle92/django-forms-frontend-validation
6
6
  Author: Andrew Kyle
@@ -34,11 +34,13 @@ The application is designed to streamline the process of form validation, ensuri
34
34
  - Includes CSRF token management for secure AJAX-based form submissions.
35
35
 
36
36
  ## Usage
37
+ ### Installation
38
+ 1. Install the Django project
39
+ ```cmd
40
+ pip install django-frontend-forms-validation
41
+ ```
37
42
  ### Setting Up
38
- 1. Include Required Components:
39
- - Include the JavaScript files in your project to enable client-side functionality.
40
- - Ensure `form_utils.py` is imported and accessible in your Django app.
41
- 2. Define Settings in settings.py
43
+ 1. Define Settings in settings.py
42
44
  - Add `formvalidator` to installed apps.
43
45
  ```python
44
46
  INSTALLED_APPS = [
@@ -54,7 +56,7 @@ The application is designed to streamline the process of form validation, ensuri
54
56
  IGNORE_VALIDATION = ['example-ignore-validation', ...]
55
57
  VALIDATE_ONLY_ON_SUBMIT = ['all'] # Options: "__all__", specific class names, or leave empty.
56
58
  ```
57
- 3. Initial Forms:
59
+ 2. Initial Forms:
58
60
  - Ensure the `_InitializeForms` method is called during page load to attach validation logic to forms dynamically.
59
61
  To your HTML template with the form, add this.
60
62
  ```html
@@ -74,7 +76,7 @@ The application is designed to streamline the process of form validation, ensuri
74
76
  });
75
77
  </script>
76
78
  ```
77
- 4. Server-Side Context:
79
+ 3. Server-Side Context:
78
80
  - Use the `FormsValidator` class to pass configuration to templates:
79
81
  ```python
80
82
  from formvalidator.form_utils import FormsValidator
@@ -87,3 +89,39 @@ The application is designed to streamline the process of form validation, ensuri
87
89
  }
88
90
  return render(request, 'my_template.html', context)
89
91
  ```
92
+ 4. Add `div` Groups to the HTML Form:
93
+ - The JavaScript in this project relies on each form field being wrapped inside an outer div with the classname of ```form-group```.
94
+ - It helps set apart each input from other inputs within the form.
95
+ - Here is an example of the setup:
96
+ ```html
97
+ <form ...>
98
+ {% csrf_token %}
99
+
100
+ <div class="form-group">
101
+ <label for="field1">Field 1</label>
102
+ <input type="text" name="field1">
103
+ </div>
104
+
105
+ <div class="form-group">
106
+ <label for="field2">Field 1</label>
107
+ <input type="text" name="field2">
108
+ </div>
109
+
110
+ <-- Adding the rest of the form groups below -->
111
+ ...
112
+ </form>
113
+ ```
114
+ - If iterating through each form input using the ```form``` context variable:
115
+ ```html
116
+ <form ...>
117
+ {% csrf_token %}
118
+
119
+ <-- iterating through each form field -->
120
+ {% for field in form %}
121
+ <div class="form-group">
122
+ <label for="{{ field.name }}">{{ field.label }}</label>
123
+ {{ field }}
124
+ </div>
125
+ {% endfor %}
126
+ </form>
127
+ ```
@@ -11,4 +11,4 @@ IGNORE_VALIDATION = [] + IGNORED_CLASSES
11
11
  # the string keyword options are 'all', '__all__', '*'
12
12
  # if you would like to keep the type as an array, but still want to hit all forms, you can just set
13
13
  # index 0 as one of those keywords
14
- VALIDATE_ONLY_ON_SUBMIT = ["*"]
14
+ VALIDATE_ONLY_ON_SUBMIT = []
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='django-forms-frontend-validation',
5
- version='1.0.4',
5
+ version='1.0.6',
6
6
  packages=find_packages(exclude=['core*']),
7
7
  include_package_data=True,
8
8
  license='MIT', # Use the license that applies to your project