Skip to content

Instantly share code, notes, and snippets.

View fchevitarese's full-sized avatar

Frederico Rodrigues Chevitarese fchevitarese

View GitHub Profile
<html>
<body>
<h1>Gallery</h1>
{% if gallery %}
{% for photo in gallery %}
<p><img src="media/{{ photo.photo }}"></p>
<p>{{ photo.description }}</p>
{% endfor %}
{% endif %}
from django.db.models.signals import post_init
def track_data(*fields):
"""
Tracks property changes on a model instance.
The changed list of properties is refreshed on model initialization
and save.
>>> @track_data('name')
# coding: utf-8
# Lista de valores que são retornados...
list_values = ("1432430070.573",
"1432430070.574",
"1432430856.584",
"1432430856.585",
"1432555386.0",
"1432555386.1",
"1432555564.3",
DoesNotExist at /accounts/google/login/
SocialApp matching query does not exist.
Request Method: GET
Request URL: http://localhost:8000/accounts/google/login/?process=login
Django Version: 1.7.4
Exception Type: DoesNotExist
Exception Value:
SocialApp matching query does not exist.
Exception Location: /home/fred/.virtualenvs/speakerfight/local/lib/python2.7/site-packages/django/db/models/query.py in get, line 357
Python Executable: /home/fred/.virtualenvs/speakerfight/bin/python
Django==1.6.11
Fabric==1.10.0
Flask==0.10.1
Jinja2==2.7.3
Markdown==2.4
MarkupSafe==0.23
Pillow==2.6.1
Pygments==1.6
South==1.0
Werkzeug==0.9.4
from django.shortcuts import render, render_to_response, get_object_or_404, HttpResponseRedirect, HttpResponse, redirect
from django.template import RequestContext, loader
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django.views.generic import UpdateView
from models import Cadastro
from .forms import CadastroForm
$.each(harvests, function() {
var tmparray = [];
tmparray.push(this.uuid);
tmparray.push(this.date);
tmparray.push(this.device);
$.each(questions, function() {
tmparray.push(this.name);
})
data.push(tmparray);
})
@fchevitarese
fchevitarese / viewver_urls.py
Created June 27, 2015 15:59
viewver_urls.py
from django.conf.urls import patterns, url, include
from rest_framework import routers
from .views.viewver import HarvestView, HarvestViewSet
router = routers.DefaultRouter()
router.register(r'api/harvest', HarvestViewSet, base_name='myharvests')
urlpatterns = patterns(
'online.views.viewver',
TypeError: harvest.$update is not a function
at controller.js:41
at k.$emit (angular.js:14598)
at HTMLInputElement.<anonymous> (ng-grid-2.0.14.min.js:2)
at HTMLInputElement.v.event.dispatch (jquery.min.js:2)
at HTMLInputElement.o.handle.u (jquery.min.js:2)
at Object.v.event.trigger (jquery.min.js:2)
at HTMLInputElement.<anonymous> (jquery.min.js:2)
at Function.v.extend.each (jquery.min.js:2)
at v.fn.v.each (jquery.min.js:2)
from rest_framework import serializers
# from dashboard.serializers import HarvestListSerializer
from team.serializers import DeviceTeamListSerializer # , DeviceSerializer
from team.models import DeviceTeam
from .models import Harvest
class BaseMeta: