Skip to content

Instantly share code, notes, and snippets.

View fchevitarese's full-sized avatar

Frederico Rodrigues Chevitarese fchevitarese

  • Vila Velha
  • 18:24 (UTC -03:00)
View GitHub Profile
@fchevitarese
fchevitarese / forms.py
Created September 17, 2015 13:47
clean_method.py
def clean(self, value):
# super(UserField, self).clean(value)
# instance = getattr(self, 'instance', None)
# if instance is None:
# try:
# User.objects.get(email=value)
# raise forms.ValidationError(
# "Someone is already using this email. Please pick an other.")
# except User.DoesNotExist:
127.0.0.1 - - [15/Sep/2015 17:31:16] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [15/Sep/2015 17:31:17] code 404, message File not found
127.0.0.1 - - [15/Sep/2015 17:31:17] "GET /vendor/font-awesome/css/font-awesome.min.css HTTP/1.1" 404 -
127.0.0.1 - - [15/Sep/2015 17:31:17] "GET /css/material.indigo-pink.min.css HTTP/1.1" 200 -
127.0.0.1 - - [15/Sep/2015 17:31:17] "GET /css/app.css HTTP/1.1" 200 -
127.0.0.1 - - [15/Sep/2015 17:31:17] "GET /cordova.js HTTP/1.1" 200 -
127.0.0.1 - - [15/Sep/2015 17:31:17] "GET /img/transparent.jpg HTTP/1.1" 200 -
127.0.0.1 - - [15/Sep/2015 17:31:17] "GET /fonts/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2 HTTP/1.1" 200 -
127.0.0.1 - - [15/Sep/2015 17:31:19] "GET /js/index.js HTTP/1.1" 200 -
127.0.0.1 - - [15/Sep/2015 17:31:19] "GET /cordova_plugins.js HTTP/1.1" 200 -
set([u'auth.add_permission', u'form.delete_option', u'rules.delete_rule', u'harvest.add_loopitemvalue', u'sessions.change_session', u'user.delete_user', u'form.delete_loop', u'authtoken.add_token', u'harvest.change_loopitemvalue', u'form.change_loop', u'form.form.can_edit_form', u'form.change_signaturequestion', u'form.change_question', u'harvest.delete_value', u'admin.change_logentry', u'quotas.add_condition', u'billing.change_accountbalance', u'harvest.add_harvest', u'contenttypes.delete_contenttype', u'billing.change_clientplan', u'harvest.add_value', u'user.add_userpermission', u'form.add_choicequestion', u'form.add_group', u'form.delete_inputoption', u'user.delete_userpermission', u'form.change_otheroption', u'form.delete_inputquestion', u'billing.delete_accountbalance', u'form.delete_question', u'user.change_user', u'quotas.change_quotaentry', u'form.change_multiplechoicequestion', u'form.add_signaturequestion', u'form.delete_release', u'form.delete_form', u'rules.add_scorerestrict', u'rules.change_rule
{% for n in user_revenda %}
<tr>
<td class="text-align-center">{{n.login}}</td>
<td class="text-align-center">{{nome_plano}}</td>
<td class="text-align-center">
{% for t in todos_planos %}
{% if n.id == t.client_id and id_plano == t.id %}
<div class=" checkbox-inline checkbox-ios">
<label for="checkbox-ios{{n.id}}">
<input type="checkbox" checked id="checkbox-ios{{n.id}}" value="{{id_plano}}" name="checkbox-ios{{n.id}}">
@fchevitarese
fchevitarese / loop.html
Last active August 27, 2015 13:52
for_template
{% for n in user_revenda %}
<tr>
<td class="text-align-center">{{n.login}}</td>
<td class="text-align-center">{{nome_plano}}</td>
<td class="text-align-center">
<div class=" checkbox-inline checkbox-ios">
<label for="checkbox-ios{{n.id}}">
{% for p in n.planocodcliente_set.all %}
{% for tp in todos_planos %}
{% if tp.plano_id == p.plano_id %}
@fchevitarese
fchevitarese / teste.html
Created August 24, 2015 18:49
sample.html
<html>
<title>Test</title>
<header>
<script language="javascript">
function myfunction(event) {
// Aqui você pode chamar outras funções tipo a de fazer o post ;)
alert("Olá!");
console.log(event);
}
</script>
@fchevitarese
fchevitarese / untitled
Created August 14, 2015 19:29
for.html
{% for n in clientes %}
<tr>
<td class="text-align-center">{{n.login}}</td>
<td class="text-align-center">{{n.senha}}</td>
<td class="text-align-center">{{n.nome}}</td>
<td class="text-align-center">{{n.cod_cliente}}</td>
<td class="text-align-center"><span class="glyphicon glyphicon-retweet" style="color: #44AD41"></span></td>
{% for p in clientes.planocliente_set.all() %}
<td>bblblbl</td>
{% endfor %}
@fchevitarese
fchevitarese / __init__.py
Created August 13, 2015 15:50
__init__.py
from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery_container import app as celery_app
@fchevitarese
fchevitarese / celery_container.py
Created August 13, 2015 15:50
celery_container.py
from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'datagoal.settings')
from django.conf import settings
@fchevitarese
fchevitarese / untitled
Created August 13, 2015 15:49
traceback.log
celery -A datagoal worker -l debug
Traceback (most recent call last):
File "/home/fred/.virtualenvs/teste/bin/celery", line 11, in <module>
sys.exit(main())
File "/home/fred/.virtualenvs/teste/local/lib/python2.7/site-packages/celery/__main__.py", line 30, in main
main()
File "/home/fred/.virtualenvs/teste/local/lib/python2.7/site-packages/celery/bin/celery.py", line 81, in main
cmd.execute_from_commandline(argv)
File "/home/fred/.virtualenvs/teste/local/lib/python2.7/site-packages/celery/bin/celery.py", line 769, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))