This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django_filters import FilterSet | |
from django_filters.filters import RangeFilter | |
from .models import People | |
from .forms import PeopleFilterFormHelper | |
from .widgets import CustomRangeWidget | |
class AllRangeFilter(RangeFilter): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
values = [p.age for p in People.objects.all()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class People(models.Model): | |
name = models.CharField(null=True,blank=True,max_length=50) | |
surname = models.CharField(null=True,blank=True,max_length=50) | |
age = models.IntegerField() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="get"> | |
{{ people_filter.form.as_p }} | |
<input type="submit" /> | |
</form> | |
<table border='1' style="width:100%; text-align:center"> | |
<thead> | |
<tr> | |
<th> Name </th> | |
<th> Surname </th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
STATICFILES_DIRS = [ BASE_DIR / 'static'] | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table border='1' style="width:100%; text-align:center"> | |
<thead> | |
<tr> | |
<th> Name </th> | |
<th> Surname </th> | |
<th> Age </th> | |
</tr> | |
</thead> | |
<tbody> |
OlderNewer