Skip to content

Instantly share code, notes, and snippets.

from decimal import Decimal
from django.utils.timezone import UTC, datetime
from model_mommy import mommy
customer = mommy.make('order.Customer', cpf='123212212-54', email='[email protected]', first_name='Carol', phone='85-988778899')
address = mommy.make('order.Address', customer=customer, address='Rua Dr.a Neyde', number='256', district='Vila Clementino', city='São Paulo', state='SP', zipcode='04022040')
seller = Seller.objects.get(name=‘sandboxintegracao’)
@mario-chaves
mario-chaves / Makefile
Created December 16, 2015 12:10
Makefile for create a simple django project
# wget --output-document=Makefile https://goo.gl/UMTpZ1
# make setup
# Colors
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
venv:
@echo "${green}>>> Creating virtualenv${reset}"
(function () {
'use strict';
/**
* @ngdoc directive
* @name app.directive:pagination
* @description
* # pagination
*/
@mario-chaves
mario-chaves / category-match.html
Created November 26, 2015 02:18
Arquivos de category match
<div class="mui-row">
<div class="mui-col-md-6">
<h2 class="labs-h2-title">Match de categorias<span ng-if="self.sellerSellected"
ng-bind="': ' + self.sellerSellected.name"></span></h2>
</div>
<div class="mui-col-md-6">
<div class="mui-dropdown mui--pull-right">
<button class="mui-btn mui-btn--flat" data-mui-toggle="dropdown">
Selecione um Seller para o match
<span class="mui-caret"></span>
(function () {
'use strict';
/**
* @ngdoc function
* @name app.controller:CategorymatchCtrl
* @description
* # CategorymatchCtrl
* Controller of the app
*/
import os
import boto
import requests
import shutil
import math
from filechunkio import FileChunkIO
from boto.s3.key import Key
def download_and_send_to_s3(aws_key, aws_secret_key, bucket_name, download_url, bucket_folder='', download_to=''):
# coding: utf-8
from __future__ import unicode_literals, absolute_import
import os
import boto
import math
from boto.s3.key import Key
import requests
import shutil
from filechunkio import FileChunkIO