from functions import add_theatre, real_run from plays.models import Play from productions.models import Production, Part, Place as ProductionPlace, ProductionCompany from people.models import Person from places.models import Place from countries.models import Country real_run() uk = Country.objects.get(iso='GB') data = json.load(open('../data/edinburgh2010.json')) for d in data: if d['festival'] != 'fringe': continue if d['main_class'] not in ('Childrens Shows', 'Dance and Physical Theatre', 'Musicals & Operas', 'Theatre'): continue venue = add_theatre(d['venue_desc'], 'Edinburgh') venue.description = d['venue_info'] venue.address = d['venue_addr'] venue.postcode = d['postcode'] venue.country = uk venue.latitude = d['event_latitude'] venue.longitude = d['event_longitude'] venue.save() event = { 'id': d['id'], 'url': d['event_url'], 'title': d['event_desc'], 'desc': d['event_info'], 'code': d['event_code'], 'category': d['main_class'],
company = None for c in data['cast']: if c[0] == "Playgoers' Society": company, created = ProductionCompany.objects.get_or_create( name="Playgoers' Society") production = Production( play=play, company=company, source= '<a href="http://ahds.ac.uk/ahdscollections/docroot/birminghamrep/birminghamrepdetails.do?id=%s">AHDS Performing Arts</a>' % data['id']) production.save() if 'theatre' in data and data['theatre']: location = add_theatre(data['theatre']) ProductionPlace.objects.get_or_create(production=production, place=location, start_date=data['first'], end_date=data['last']) else: location, created = Place.objects.get_or_create(name='Unknown') ProductionPlace.objects.get_or_create(production=production, place=location, start_date=data['first'], end_date=data['last']) for c in data['cast']: if c[0] == 'Cast Unknown' or c[0] == "Playgoers' Society": continue person = add_person_nicely(c[1], c[0])
company = None for c in data["cast"]: if c[0] == "Playgoers' Society": company, created = ProductionCompany.objects.get_or_create(name="Playgoers' Society") production = Production( play=play, company=company, source='<a href="http://ahds.ac.uk/ahdscollections/docroot/birminghamrep/birminghamrepdetails.do?id=%s">AHDS Performing Arts</a>' % data["id"], ) production.save() if "theatre" in data and data["theatre"]: location = add_theatre(data["theatre"]) ProductionPlace.objects.get_or_create( production=production, place=location, start_date=data["first"], end_date=data["last"] ) else: location, created = Place.objects.get_or_create(name="Unknown") ProductionPlace.objects.get_or_create( production=production, place=location, start_date=data["first"], end_date=data["last"] ) for c in data["cast"]: if c[0] == "Cast Unknown" or c[0] == "Playgoers' Society": continue person = add_person_nicely(c[1], c[0]) Part.objects.get_or_create(production=production, person=person, cast=True)
play = Play.objects.get(title=title, authors=None) play.authors.add(person) except: play = Play(title=title) play.save() play.authors.add(person) else: try: play = Play.objects.get(title=title, authors=None) except: play = Play(title=title) play.save() source = '<a href="http://www.bristol.ac.uk/theatrecollection/search/%s">University of Bristol Theatre Collection</a>' % search_link production = Production( play = play, description = notes, source = source, ) production.save() location = add_theatre(theatre) start_date = '%d-00-00' % n end_date = '%d-00-00' % (n+1) ProductionPlace.objects.get_or_create(production=production, place=location, start_date=start_date, end_date=end_date) for forename, surname, cast, role in people: person, created = Person.objects.get_or_create(first_name=forename, last_name=surname) part = Part.objects.get_or_create(production=production, person=person, role=role, cast=cast)
from functions import add_theatre, real_run from plays.models import Play from productions.models import Production, Part, Place as ProductionPlace, ProductionCompany from people.models import Person from places.models import Place from countries.models import Country real_run() uk = Country.objects.get(iso='GB') data = simplejson.load(open('../data/edinburgh2010.json')) for d in data: if d['festival'] != 'fringe': continue if d['main_class'] not in ('Childrens Shows', 'Dance and Physical Theatre', 'Musicals & Operas', 'Theatre'): continue venue = add_theatre(d['venue_desc'], 'Edinburgh') venue.description = d['venue_info'] venue.address = d['venue_addr'] venue.postcode = d['postcode'] venue.country = uk venue.latitude = d['event_latitude'] venue.longitude = d['event_longitude'] venue.save() event = { 'id': d['id'], 'url': d['event_url'], 'title': d['event_desc'], 'desc': d['event_info'], 'code': d['event_code'], 'category': d['main_class'],
from countries.models import Country # real_run() uk = Country.objects.get(iso="GB") file = csv.reader(open("../data/festivalfm/performer.csv"), quotechar="'") performer = {} for row in file: performer[row[0]] = row[1] file = csv.reader(open("../data/festivalfm/venue.csv"), quotechar="'") venue_by_id = {} for row in file: id, name, address, postcode, latitude, longitude, description, access = row venue = add_theatre(name, "Edinburgh") venue.country = uk if not venue.address and address: venue.address = address if not venue.postcode and postcode: venue.postcode = postcode if not venue.latitude and float(latitude): venue.latitude = latitude if not venue.longitude and float(longitude): venue.longitude = longitude if not venue.description and description: venue.description = "%s\n\n%s" % (description, access) venue.save() venue_by_id[id] = venue file = csv.reader(open("../data/festivalfm/show.csv"), quotechar="'")