This file contains 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
import functools # Part of Python standard library | |
def decorator(wrapped_function): | |
def _wrapper(*args, **kwargs): | |
# do something before the function call | |
result = wrapped_function(*args, **kwargs) | |
# do something after the function call | |
return result | |
return _wrapper |
This file contains 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
{% extends 'base.html' %} | |
{% load staticfiles %} | |
{% load selectize_tags %} | |
{% block extra_css %} | |
{% selectize_tags_media 'css' %} | |
{% endblock extra_css %} | |
{% block content %} | |
<form class="form-horizontal" action="." method="post"> |
This file contains 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
var link = $(".btn"); | |
link.click( | |
function(event){ | |
//eliminate the default function | |
event.preventDefault(); | |
$.ajax({ | |
url: '/formulario/', | |
data: $('#new-form').serialize(), | |
type: "POST", |
This file contains 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
#models.py | |
#Stdlib imports | |
import datetime | |
#Django core Imports | |
from django.db import models | |
from django.contrib.auth.models import ( | |
BaseUserManager, AbstractBaseUser, PermissionsMixin | |
) |
NewerOlder