Skip to content

Instantly share code, notes, and snippets.

View mmtechslv's full-sized avatar
Coding

Farid MUSA mmtechslv

Coding
View GitHub Profile
@mmtechslv
mmtechslv / Markdium-HTML.html
Created April 7, 2021 15:48
Markdium-Introduction
<table border='1' style="width:100%; text-align:center">
<thead>
<tr>
<th> Name </th>
<th> Surname </th>
<th> Age </th>
</tr>
</thead>
<tbody>
@mmtechslv
mmtechslv / Markdium-python.py
Created April 7, 2021 15:48
Markdium-Introduction
...
STATICFILES_DIRS = [ BASE_DIR / 'static']
...
@mmtechslv
mmtechslv / Markdium-HTML.html
Created April 7, 2021 15:48
Markdium-Introduction
<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>
@mmtechslv
mmtechslv / Markdium-python.py
Created April 7, 2021 15:48
Markdium-Introduction
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()
@mmtechslv
mmtechslv / Markdium-python.py
Created April 7, 2021 15:48
Markdium-Introduction
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()]
@mmtechslv
mmtechslv / Markdium-HTML.html
Created April 7, 2021 15:48
Markdium-Introduction
{% load static %}
{% load crispy_forms_tags %}
<head>
<link rel="stylesheet" href="{% static 'custom_slider.css' %}"> # CSS of our range-slider.
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
@mmtechslv
mmtechslv / Markdium-python.py
Created April 7, 2021 15:48
Markdium-Introduction
import django_filters
from .models import People
class PeopleFilter(django_filters.FilterSet):
age = django_filters.AllValuesFilter()
class Meta:
model = People
fields = ['age']
@mmtechslv
mmtechslv / Markdium-Shell.bash
Created April 7, 2021 15:48
Markdium-Introduction
$ python manage.py makemigrations
$ python manage.py migrate
@mmtechslv
mmtechslv / Markdium-HTML.html
Created April 7, 2021 15:48
Markdium-Introduction
<div class="form-group numeric-slider" {% include "django/forms/widgets/attrs.html" %}>
<div class="numeric-slider-range ui-slider ui-slider-horizontal ui-slider-range"></div>
<span class="numeric-slider-range_text" id='{{ widget.attrs.id }}_text'>
{{ widget.value_text }}
</span>
{% for widget in widget.subwidgets %}
{% include widget.template_name %}
{% endfor %}
</div>
@mmtechslv
mmtechslv / Markdium-Shell.bash
Created April 7, 2021 15:48
Markdium-Introduction
$ mkdir myproject
$ cd myproject
$ pipenv shell