This is a common case in django ORM.
from django.db import models
class Author(models.Model):
Find what: | |
`(href|src)="([a-zA-Z0-9/.-]+[^.html])"` | |
Replace with: | |
`$1=\"{% static "assets/$2" %}"` |
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>PUT</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>*</AllowedHeader> |
## Got this script initially from https://gist.github.com/kbl/5970131 | |
########### | |
# IMPORTS # | |
########### | |
import ConfigParser | |
import argparse | |
import json | |
import os |
function initialize() { | |
// Exibir mapa; | |
var myLatlng = new google.maps.LatLng(-8.0631495, -34.87131120000004); | |
var mapOptions = { | |
zoom: 17, | |
center: myLatlng, | |
panControl: false, | |
// mapTypeId: google.maps.MapTypeId.ROADMAP | |
mapTypeControlOptions: { |
from django.contrib import admin | |
from .models import Gallery, Image | |
class ImageInline(admin.StackedInline): | |
model = Image | |
extra = 0 | |
fields = ('image',) | |
# Import datetime | |
from datetime import date | |
today = datetime.today() | |
date = date.fromordinal(today.toordinal() - 30) # today - 30 days | |
object_list = Model.objects.filter(date_at__gte=date) |
# views.py - django app called ajx | |
from django.shortcuts import render, get_object_or_404, redirect, HttpResponse, render_to_response, HttpResponseRedirect | |
from django.core.urlresolvers import reverse | |
from django.contrib.auth import authenticate, login | |
import json | |
def mygetview(request): | |
if request.method == 'GET': |
class PaiFilhosInline(admin.StackedInline): | |
model = PaiFilhos | |
fk_name = 'pai' | |
raw_id_fields = ['filho'] | |
class PaiAdmin(models.ModelAdmin): | |
inlines = [PaiFilhosInline] | |
# coding=utf-8 | |
""" | |
NAO FUNCIONA MAIS. O sistema de CAPTCHA foi trocado. | |
**Implementa um Webcrawler para extracao de dados da pesquisa de media de precos realizada periodicamente pela ANP** | |
Desenvolvido por Fabio C. Barrionuevo da Luz. - 2013 | |
Simple crawler to ANP site | |
Copyright (C) 2013 Fabio C. Barrionuevo da Luz. | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License |