pagination02 - With Filter applied + templatetags
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
first_name | last_name | |
---|---|---|
Elliot | Alderson | |
Edward | Alderson | |
Angela | Moss | |
Darlene | Alderson | |
Tyrell | Wellick | |
Joanna | Wellick | |
Phillip | Price | |
Whiterose | ||
Ollie | Parker |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<!-- jQuery --> | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | |
</head> | |
<body> |
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
// Autocomplete | |
$('#id_email').autocomplete({ | |
source: "{% url 'autocomplete_user_email' %}", | |
}); |
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
# Verificando se todos os campos do model estão preenchidos | |
from django.contrib.auth.models import User | |
from django.forms import model_to_dict | |
mymodel = User.objects.last() | |
exclude_fields = ['id', 'last_login', 'date_joined'] | |
def is_complete(mymodel, exclude_fields): | |
# Listando todos os campos | |
fields = model_to_dict(mymodel, fields=[field.name for field in mymodel._meta.fields]) |
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
<script> | |
function printDiv(divName) { | |
var printContents = document.getElementById(divName).innerHTML; | |
var originalContents = document.body.innerHTML; | |
document.body.innerHTML = printContents; | |
window.print(); | |
document.body.innerHTML = originalContents; |
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 import forms | |
from .models import Expense, Person | |
class PersonForm(ModelForm): | |
cpf = forms.CharField( | |
label=_('CPF'), | |
widget=forms.TextInput(attrs={'required': 'True'}) | |
) |
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
<!-- https://djangosnippets.org/snippets/474/ --> | |
{% load widget_tweaks %} | |
<style> | |
span.required:after { | |
content: "*"; | |
color: red; | |
} | |
</style> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="shortcut icon" href="http://html5-training-in-hyderabad.blogspot.com.br/favicon.ico"> | |
<title>My Gist</title> | |
<!-- Bootstrap core CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<!-- Font-awesome --> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.