Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ __pycache__/

# C extensions
*.so
*.c
*.cpp

# Distribution / packaging
.Python
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.7-slim

WORKDIR /app

RUN apt-get update && apt-get install -y gcc python3-dev git
RUN apt-get update && apt-get install -y gcc g++ python3-dev git

COPY pyproject.toml /app

Expand Down
5 changes: 3 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include docs/index.rst
include docs/source/index.rst
include LICENSE
include docs/changelog.rst
include docs/source/changelog.rst
recursive-include flask_inputfilter *.py *.pyx *.c *.cpp
prune tests
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Definition

class UpdateZipcodeInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'id',
Expand Down
10 changes: 10 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ Changelog

All notable changes to this project will be documented in this file.

[0.4.0a1] - 2025-04-17
----------------------

Changed
^^^^^^^
- InputFilter now uses cython for performance improvements.
- Made super().__init__() call optional. You will only need to call it,
if you are wanting to limit the allowed methods.


[0.3.1] - 2025-04-14
--------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project = "flask-inputfilter"
copyright = "2025, Leander Cain Slotosch"
author = "Leander Cain Slotosch"
release = "0.3.1"
release = "0.4.0a1"

extensions = ["sphinx_rtd_theme"]

Expand Down
1 change: 0 additions & 1 deletion docs/source/guides/frontend_validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Example implementation

class UpdateZipcodeInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'id',
Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Definition

class UpdateZipcodeInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'id',
Expand Down
18 changes: 0 additions & 18 deletions docs/source/options/condition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Example

class TestInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'username',
Expand Down Expand Up @@ -89,7 +88,6 @@ Validates that the length of the array from ``first_array_field`` is equal to th

class ArrayLengthFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'list1',
Expand Down Expand Up @@ -129,7 +127,6 @@ Validates that the array in ``longer_field`` has more elements than the array in

class ArrayComparisonFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'list1',
Expand Down Expand Up @@ -171,7 +168,6 @@ Executes the provided callable with the input data. The condition passes if the

class CustomFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'age',
Expand Down Expand Up @@ -205,7 +201,6 @@ Validates that the values of ``first_field`` and ``second_field`` are equal. Fai

class EqualFieldsFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'password'
Expand Down Expand Up @@ -242,7 +237,6 @@ Counts the number of specified fields present in the data and validates that the

class ExactFieldsFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'field1'
Expand Down Expand Up @@ -284,7 +278,6 @@ Validates that exactly ``n`` fields among the specified ones have the given valu

class MatchFieldsFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'field1'
Expand Down Expand Up @@ -320,7 +313,6 @@ Validates that only one field among the specified fields exists in the input dat

class OneFieldFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'email'
Expand Down Expand Up @@ -357,7 +349,6 @@ Validates that exactly one of the specified fields has the given value.

class OneMatchFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'option1'
Expand Down Expand Up @@ -395,7 +386,6 @@ Validates that the integer value from ``bigger_field`` is greater than the value

class NumberComparisonFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'field_should_be_bigger',
Expand Down Expand Up @@ -434,7 +424,6 @@ Validates that the count of the specified fields present is greater than or equa

class MinimumFieldsFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'field1'
Expand Down Expand Up @@ -476,7 +465,6 @@ Validates that the count of fields matching the given value is greater than or e

class MinimumMatchFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'field1'
Expand Down Expand Up @@ -513,7 +501,6 @@ Validates that the values of ``first_field`` and ``second_field`` are not equal.

class DifferenceFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'field1'
Expand Down Expand Up @@ -549,7 +536,6 @@ Validates that at least one field from the specified list is present. Fails if n

class OneFieldRequiredFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'email'
Expand Down Expand Up @@ -586,7 +572,6 @@ Validates that at least one field from the specified list has the given value.

class OneMatchRequiredFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'option1'
Expand Down Expand Up @@ -624,7 +609,6 @@ If the value of ``condition_field`` matches the specified value (or is in the sp

class ConditionalRequiredFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'status'
Expand Down Expand Up @@ -667,7 +651,6 @@ Validates that the string in ``longer_field`` has a greater length than the stri

class StringLengthFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'description'
Expand Down Expand Up @@ -704,7 +687,6 @@ Validates that the date in ``smaller_date_field`` is earlier than the date in ``

class DateOrderFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
'start_date'
Expand Down
2 changes: 0 additions & 2 deletions docs/source/options/copy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Basic Copy Integration

class MyInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
"username"
Expand Down Expand Up @@ -57,7 +56,6 @@ The coping can also be used as a chain.

class MyInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
"username"
Expand Down
1 change: 0 additions & 1 deletion docs/source/options/deserialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ into an instance of the model class, if there is a model class set.

class UserInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.setModel(User)

Expand Down
1 change: 0 additions & 1 deletion docs/source/options/external_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Basic External API Integration

class MyInputFilter(InputFilter):
def __init__(self):
super().__init__()

self.add(
"user_id", required=True
Expand Down
Loading