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
# -*- coding: utf-8 -*- | |
import json | |
import requests | |
import hashlib | |
REPORTS = 'reports' | |
PAYMENTS = 'payments' | |
class PayU(object): |
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
###Tomado de StackOverflow http://stackoverflow.com/questions/9585491/how-do-i-pass-get-parameters-using-django-urlresolvers-reverse | |
def build_url(*args, **kwargs): | |
import urllib | |
from django.core.urlresolvers import reverse | |
get = kwargs.pop('get', {}) | |
url = reverse(*args, **kwargs) | |
if get: |
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
# encoding: utf-8 | |
class Color(object): | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import atexit, os, sys, time | |
from signal import SIGTERM | |
from django.utils.daemonize import become_daemon | |
from color import Color |
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
from django.conf import settings | |
from pymongo import MongoClient | |
from pymongo.errors import AutoReconnect#, OperationFailure, ConnectionFailure | |
class MongoDB(object): | |
#def __init__(self, *args, **kwargs): | |
def __init__(self, username=None, password=None, source=None, *args, **kwargs): | |
self.username = username | |
self.password = password |
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 socket | |
from httplib import HTTPSConnection, HTTPConnection, HTTPException | |
from sys import version_info | |
from urllib import urlencode | |
from .utils_urls import parse_url, THTTPConnection, THTTPSConnection | |
from django.utils.http import urlquote | |
class HttpRequest(object): | |
def __init__(self, url, **kwargs): |
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
# -*- coding: utf-8 -*- | |
#from urllib import urlencode | |
from General.utils.errors import ResponseError | |
from django.core.validators import URLValidator | |
from django.utils.http import urlencode as django_urlencode | |
import Simoba.paypal as paypal | |
from General.utils.http import HttpRequest |
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 "sistemav2/layouts/layout.html" %} | |
{% load staticfiles %} | |
{% block css %} | |
<!-- <link rel="stylesheet" type="text/css" href="{% static 'sistemav2/css/dashboard.css' %}"> | |
<link rel="stylesheet" type="text/css" href="{% static 'sistemav2/css/pagos.css' %}"> | |
<link rel="stylesheet" type="text/css" href="{% static 'sistemav2/css/styles.css' %}"> | |
<link rel="stylesheet" href="{% static 'simoba/css/domiciliacion.css' %}"> --> | |
{% endblock %} |
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
def obtener_pago_banner(numero_pago, id_usuario): | |
from General.banner.models import Tvraccd, Tbraccd | |
from django.contrib.auth.models import User | |
usuario = User.objects.get(pk=id_usuario) | |
return Tbraccd.objects.get(tbraccd_tran_number=numero_pago, tbraccd_pidm=usuario.datosusuario.pidm) | |
def obtener_pago_cargos_banner(pago): | |
from General.banner.models import Tvrappl | |
from General.banner.models import Tvraccd | |
pago_espejo = Tvraccd.objects.get(tvraccd_accd_tran_number=pago.tbraccd_tran_number, tvraccd_pidm=pago.tbraccd_pidm) |
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 csv | |
data = list() | |
with open('Base.csv', 'rU') as f: | |
reader = csv.DictReader(f, quotechar='|', quoting=csv.QUOTE_MINIMAL) | |
for row in reader: | |
for (k,v) in row.items(): | |
z = k.replace('\t', ",") | |
n = v.replace('\t', ",") | |
num = {str(reader.line_num):(z.split(','), n.split(','))} |