Skip to content

Instantly share code, notes, and snippets.

View camilosanchez's full-sized avatar

Camilo Sanchez camilosanchez

  • Santo Domingo, Dominican Republic
View GitHub Profile
@camilosanchez
camilosanchez / objects.js
Created September 27, 2015 20:41
Course on objects from hack reactor
var box = {}; // created an empty object and stored it in a variable called box.
@camilosanchez
camilosanchez / markup.css
Last active August 29, 2015 14:13
modulo distribucion huespedes en habitaciones
/* drag and drop module V2 */
.drop-to{
border: 1px dashed #ddd;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
min-height: 310px;
padding: 5px;
if self.steps.current == 'step4':
form_asistente = FormStep4
actividades = EventActivity.objects.all()
form_items = [ item.activityassist.all() for item in actividades ]
context['activity_form_items'] = zip(actividades, form_items)
# Sir Francis Drake Excercises
from django.shortcuts import render
from django.contrib.formtools.wizard.views import SessionWizardView
from django.forms.formsets import formset_factory
from .forms import FormStep1, FormStep2, FormStep3, FormStep4, FormStep5, FormStep6, DetalleHotel, DetalleCustom
from .models import Registration
from apps.activities.models import EventActivity
FORMS = [
("step1", FormStep1),
class RegisterStepsWizard(SessionWizardView):
instance = None
# mi función para crear una instancia de ActivityAssist por cada instancia de Activity que exista
def activity_forms():
activity_object = Activity.objects.all()
new_activity = FormStep4()
items = []
for a in activity_object:
@camilosanchez
camilosanchez / gist:8297338
Created January 7, 2014 10:12
this is the view for the updateview of my form. Is the detail of my form after you click on one of the items in the list.
<h1>Dashboard</h1>
<h4>Hola {{ user }}</h4>
<form name ="offers_update_form" action="/dashboard/edit/" method="post"> {% csrf_token %}
{{offer_form.as_p}}
<input type="submit" value="Edit offer" />
</form>
@camilosanchez
camilosanchez / gist:8297321
Created January 7, 2014 10:11
this is the main view, the one that builds the list of items
{% load url from future %}
<h1>Dashboard</h1>
<h4>Hola {{ user }}</h4>
<a href="/offers/logout/">Logout</a>
<h3>Mis ofertas</h3>
<ul>
{% for offer in offer_list %}
<li><a href="{% url 'edit' offer.pk %}">{{ offer.offer_title }}</a></li>
{% empty %}
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from offers.views import *
urlpatterns = patterns('',
# Examples:
from django import forms
from django.forms import ModelForm
from models import Offer, Consumer
# Login Form
#class LoginForm(forms.Form):
# username = forms.EmailField()
# password = forms.CharField(widget=forms.PasswordInput())
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.template import RequestContext
from django.shortcuts import render_to_response, render
from django.core.exceptions import ObjectDoesNotExist
from django.views.generic import ListView
from django.views.generic.edit import UpdateView
from django.core.urlresolvers import reverse
from forms import *