Skip to content

Instantly share code, notes, and snippets.

View rudmanmrrod's full-sized avatar
🔥
On fire coding!

Rodrigo Boet rudmanmrrod

🔥
On fire coding!
View GitHub Profile
@rudmanmrrod
rudmanmrrod / create.user.html
Last active November 19, 2018 21:27
For django + vuejs integration
<script>
var app = new Vue({
delimiters: ['[[', ']]'],
el: '#app',
data: {
csrfmiddlewaretoken: '',
username: '',
email: '',
password1: '',
password2: '',
{% extends "base.html" %}
{% load staticfiles %}
{% block 'content %}
<h1 class="text-center">Create User</h1><hr>
<form id="app" v-on:submit.prevent="onSubmit">
{% csrf_token %}
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-4">
<label>{{form.username.label}}</label>
@rudmanmrrod
rudmanmrrod / test_case_profile.py
Created January 16, 2019 14:31
Prueba de perfil normal en django
class ProfileTest(TestCase):
"""!
Clase para probar el perfil
"""
def setUp(self):
"""!
Método para configurar los valores iniciales de
la prueba unitaria
"""
@rudmanmrrod
rudmanmrrod / test_case_profile_rest.py
Created January 16, 2019 14:45
Prueba unitaria de modelo perfil en django
class ProfileRestTest(TestCase):
"""!
Clase para probar el perfil por servicios rest
"""
def setUp(self):
"""!
Método para configurar los valores iniciales de
la prueba unitaria
"""
from rest_framework import viewsets, status
from rest_framework.response import Response
from .models import *
from .serializers import *
class CancionesForAlbumViewSet(viewsets.ModelViewSet):
"""!
Vistas para registrar las canciones de un album
@author Rodrigo Boet (rudmanmrrod at gmail.com)
@rudmanmrrod
rudmanmrrod / forms.py
Created October 21, 2019 16:03 — forked from cansadadeserfeliz/forms.py
Django: pass a variable from a form view to a form
class MyForm(forms.ModelForm):
requested_asset = None
def __init__(self, *args, **kwargs):
other_variable = kwargs.pop('other_variable')
super(MyForm, self).__init__(*args, **kwargs)
@rudmanmrrod
rudmanmrrod / subcategory_simple.js
Created January 17, 2020 19:38
Agregar categoría sencilla
var results = [
{
"id": 3,
"soft_delete": false,
"name": "Bebidas frias",
"order": 1,
"menu": 1,
"sub_category": 2
},
{
var results = [
{
"id": 3,
"soft_delete": false,
"name": "Bebidas frias",
"order": 1,
"menu": 1,
"sub_category": 2
},
{