Skip to content

Commit

Permalink
Adding new website
Browse files Browse the repository at this point in the history
  • Loading branch information
jenikm committed Oct 31, 2011
1 parent 48f4195 commit 742e5f3
Show file tree
Hide file tree
Showing 40 changed files with 189 additions and 4,806 deletions.
32 changes: 32 additions & 0 deletions WWW/bulkloader.yaml
Expand Up @@ -10,6 +10,9 @@
# object. If you would like automatic key generation on import and # object. If you would like automatic key generation on import and
# omitting the key on export, you can remove the entire __key__ # omitting the key on export, you can remove the entire __key__
# property from the property map. # property from the property map.
#appcfg.py upload_data --config_file=bulkloader.yaml --filename=sightings.csv --kind=Sighting --url=http://it-came-out-of-the-sky.appspot.com/_ah/remote_api
#python /opt/google_appengine/remote_api_shell.py -s it-came-out-of-the-sky.appspot.com



# If you have module(s) with your model classes, add them here. Also # If you have module(s) with your model classes, add them here. Also
# change the kind properties to model_class. # change the kind properties to model_class.
Expand All @@ -23,6 +26,35 @@ python_preamble:
- import: google.appengine.api.users - import: google.appengine.api.users


transformers: transformers:

- kind: City
connector: csv # TODO: Choose a connector here: csv, simplexml, etc...
connector_options:
# TODO: Add connector options here--these are specific to each connector.
property_map:
- property: city_id
external_name: city_id
import_transform: int

- property: county_id
external_name: county_id
import_transform: int

- property: state_id
external_name: state_id
import_transform: int

- property: name
external_name: name

- property: lat
external_name: lat
import_transform: float

- property: lon
external_name: lon
import_transform: float

- kind: Sighting - kind: Sighting
connector: csv # TODO: Choose a connector here: csv, simplexml, etc... connector: csv # TODO: Choose a connector here: csv, simplexml, etc...
connector_options: connector_options:
Expand Down
Binary file removed WWW/images/facebook.png
Binary file not shown.
Binary file removed WWW/images/flickr.png
Binary file not shown.
Binary file removed WWW/images/gallery/image_01.jpg
Binary file not shown.
Binary file removed WWW/images/gallery/image_02.jpg
Binary file not shown.
Binary file removed WWW/images/gallery/image_03.jpg
Binary file not shown.
Binary file removed WWW/images/gallery/image_04.jpg
Binary file not shown.
Binary file removed WWW/images/gallery/image_05.jpg
Binary file not shown.
Binary file removed WWW/images/gallery/image_06.jpg
Binary file not shown.
Binary file removed WWW/images/myspace.png
Binary file not shown.
Binary file removed WWW/images/onebit_08.png
Binary file not shown.
Binary file removed WWW/images/onebit_11.png
Binary file not shown.
Binary file removed WWW/images/onebit_12.png
Binary file not shown.
Binary file removed WWW/images/onebit_17.png
Binary file not shown.
Binary file removed WWW/images/onebit_21.png
Binary file not shown.
Binary file removed WWW/images/readmore.png
Binary file not shown.
Binary file removed WWW/images/templatemo-list.png
Binary file not shown.
Binary file removed WWW/images/templatemo_body.jpg
Binary file not shown.
Binary file removed WWW/images/templatemo_followus.png
Binary file not shown.
Binary file removed WWW/images/templatemo_image_01.jpg
Binary file not shown.
Binary file removed WWW/images/templatemo_image_02.jpg
Binary file not shown.
Binary file removed WWW/images/templatemo_image_03.jpg
Binary file not shown.
Binary file removed WWW/images/templatemo_image_04.jpg
Binary file not shown.
Binary file removed WWW/images/templatemo_logo.png
Binary file not shown.
Binary file removed WWW/images/templatemo_menu.png
Binary file not shown.
Binary file removed WWW/images/templatemo_menu_hover.png
Binary file not shown.
Binary file removed WWW/images/templatemo_wrapper.jpg
Diff not rendered.
Binary file removed WWW/images/twitter.png
Diff not rendered.
Binary file removed WWW/images/youtube.png
Diff not rendered.
53 changes: 46 additions & 7 deletions WWW/it_came_out_of_the_sky.py
Expand Up @@ -4,6 +4,7 @@
from google.appengine.ext.webapp import template from google.appengine.ext.webapp import template
from google.appengine.ext import db from google.appengine.ext import db
from django.core import serializers from django.core import serializers
import datetime


views_path = 'views/' views_path = 'views/'
#execfile("db.py") #execfile("db.py")
Expand All @@ -20,30 +21,68 @@ class Sighting(db.Model):
occurred_at = db.DateTimeProperty occurred_at = db.DateTimeProperty
reported_at = db.DateTimeProperty reported_at = db.DateTimeProperty
posted_at = db.DateTimeProperty posted_at = db.DateTimeProperty
def summary_description_short(self):
shortened = self.summary_description
if len(self.summary_description) > 50:
shortened = (self.summary_description[:50] + '..')
return shortened
def created_at_formatted(self):
return self.occurred_at.datetime.strftime("%m-%d-%y")
def show_date(self):
return False #hasattr(self.sighting.occurred_at.datetime, 'month')


class Main(webapp.RequestHandler): class City(db.Model):
city_id = db.IntegerProperty()
county_id= db.IntegerProperty()
state_id = db.IntegerProperty()
name = db.StringProperty()
lat = db.FloatProperty()
lon = db.FloatProperty()

class Index(webapp.RequestHandler):
def get(self): def get(self):
template_values = {'main': 'selected' } template_values = {'current_page': 'home' }
path = os.path.join(os.path.dirname(__file__), views_path + 'index.html') path = os.path.join(os.path.dirname(__file__), views_path + 'index.html')
self.response.out.write(template.render(path, template_values)) self.response.out.write(template.render(path, template_values))


class LoadSightings(webapp.RequestHandler): class Photos(webapp.RequestHandler):
def get(self):
template_values = {'current_page': 'photos' }
path = os.path.join(os.path.dirname(__file__), views_path + 'photos.html')
self.response.out.write(template.render(path, template_values))


class Download(webapp.RequestHandler):
def get(self): def get(self):
self.response.out.write("DONE") template_values = {'current_page': 'download' }
path = os.path.join(os.path.dirname(__file__), views_path + 'download.html')
self.response.out.write(template.render(path, template_values))
class Search(webapp.RequestHandler):
def get(self):
city_name = self.request.get("city_name")
cities = City.all().filter("name = ", city_name.lower().capitalize()).fetch(limit=10)
sightings = []
if len(cities) > 0:
sightings = Sighting.all().filter("city_id IN ", map((lambda x: x.city_id), cities)).fetch(limit=100)
template_values = {'current_page': 'search', 'sightings': sightings, 'city_name': city_name }
path = os.path.join(os.path.dirname(__file__), views_path + 'search.html')
self.response.out.write(template.render(path, template_values))


class Sightings(webapp.RequestHandler):


class Sightings(webapp.RequestHandler):
def get(self): def get(self):
template_values = {'main': 'selected' } template_values = {'main': 'selected' }
sighting_id = self.request.get("sighting_id") sighting_id = self.request.get("sighting_id")
response = -1 response = -1
if sighting_id != '': if sighting_id != '':
response = db.GqlQuery("SELECT * FROM Sighting WHERE sighting_id = :1", int(sighting_id)).get().to_xml() response = db.GqlQuery("SELECT * FROM Sighting WHERE sighting_id = :1", int(sighting_id)).get().to_xml()
self.response.out.write('<?xml version="1.0"?>'); self.response.out.writeln('<?xml version="1.0"?>');
self.response.out.write(response) self.response.out.write(response)


application = webapp.WSGIApplication([('/', Main), ('/sightings', Sightings), ('/_ah/remote_api', LoadSightings)], application = webapp.WSGIApplication([('/', Index),
('/sightings', Sightings),
('/photos', Photos),
('/search', Search),
('/download', Download)],
debug=True) debug=True)


def main(): def main():
Expand Down
108 changes: 0 additions & 108 deletions WWW/js/coda-slider.js

This file was deleted.

0 comments on commit 742e5f3

Please sign in to comment.