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
/* | |
This file is part of JonDesign's SmoothGallery v1.2. | |
JonDesign's SmoothGallery is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2 of the License, or | |
(at your option) any later version. | |
JonDesign's SmoothGallery is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
document.getElementById("").onkeyup = function() { limitArea(this, '60', ''); } |
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
class Address(models.Model): | |
street = models.CharField(max_length=150) | |
street_slug = models.SlugField() | |
city = models.ForeignKey(City) | |
property_value = models.IntegerField(max_length=12, blank=True, null=True) | |
owner = models.ManyToManyField(Person, blank=True, null=True) | |
def __unicode__(self): | |
return self.street |
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
class Address(models.Model): | |
street = models.CharField(max_length=150) | |
street_slug = models.SlugField() | |
city = models.ForeignKey(City) | |
property_value = models.IntegerField(max_length=12, blank=True, null=True) | |
owner = models.ManyToManyField(Person, blank=True, null=True) | |
def __unicode__(self): | |
return self.street | |
def full_address(self): | |
return u"%s, %s, %s" % (self.city.state, self.city, self.street) |
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
{% easy_map f.location.full_address 200 200 %} |
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
class Geocode(models.Model): | |
address = models.ForeignKey(Address) | |
computed_address = models.CharField(max_length=255, null=True, blank=True) | |
latitude = models.FloatField(null=True, blank=True) | |
longitude = models.FloatField(null=True, blank=True) | |
geocode_error = models.BooleanField(default=False) | |
def fill_geocode_data(self): | |
if not self.address: | |
self.geocode_error = True | |
return |
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 get_lat(self): | |
geocode = self.geocode_set.all()[0] | |
return geocode.latitude | |
def get_long(self): | |
geocode = self.geocode_set.all()[0] | |
return geocode.longitude |
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
geocode = models.ForeignKey(Geocode, null=True, blank=True) | |
def save(self, *args, **kwargs): | |
if not self.geocode: | |
g = Geocode(address=self.location) | |
g.fill_geocode_data() | |
g.save() | |
self.geocode = g | |
super(Fire, self).save(*args, **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
<script type="text/javascript" | |
src="http://maps.google.com/maps/api/js?sensor=false"> | |
</script> | |
<script type="text/javascript"> | |
function initialize() { | |
var latlng = new google.maps.LatLng(38.922950 , -97.734375); | |
var myOptions = { | |
zoom: 4, | |
center: latlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP |
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
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$.getJSON('http://search.twitter.com/search.json?q=earthquake&callback=?', function(data) { | |
var data = data.results; | |
var html = "<ul>"; | |
for(var i=0; i<data.length; i++) { | |
html += "<li><a href='http://twitter.com/" + data[i].from_user + "'>@" + data[i].from_user + "</a>: " + data[i].text + "</li>"; |
OlderNewer