예제 #1
0
def create(request):

    params = {}

    form = VenuesForm(initial={
        'name': '',
        'address': '',
        'city': '',
        'state': '',
        'zip': '',
    })
    if request.method == 'POST':
        form = VenuesForm(request.POST)
        if form.is_valid():
            venue = hmod.Venue()
            venue.name = form.cleaned_data['name']
            venue.address = form.cleaned_data['address']
            venue.city = form.cleaned_data['city']
            venue.state = form.cleaned_data['state']
            venue.zip = form.cleaned_data['zip']
            venue.save()
            return HttpResponseRedirect('/homepage/venues/')

    params['form'] = form

    return templater.render_to_response(request, 'venues_edit.html', params)
예제 #2
0
파일: venues.py 프로젝트: rodcox89/chf
def create(request):
    params = {}

    venue = hmod.Venue()
    venue.name = ''
    venue.description = ''
    venue.save()

    return HttpResponseRedirect('/administration/venues.edit/{}/'.format(
        venue.id))
예제 #3
0
def create(request):
    # params = {}

    venue = hmod.Venue()
    venue.name = ''
    venue.address = ''
    venue.city = ''
    venue.state = ''
    venue.zip = None
    venue.save()

    return HttpResponseRedirect('/events/venue.edit/{}'.format(venue.id))
예제 #4
0
def create(request):

    if not request.user.is_authenticated():
        return redirect('/homepage/login/?next=%s' % request.path)
    if not request.user.is_staff:
        return HttpResponseRedirect('/homepage/authentication')

    venue = hmod.Venue()

    venue.name = ''
    venue.address = ''
    venue.city = ''
    venue.state = ''
    venue.zip = 12345
    # venue.event = '' this needs to be an instance of the event model for the db to accept

    venue.save()

    return HttpResponseRedirect('/homepage/venues.edit/{}/'.format(venue.id))
    agent.appointment_date = data[10]
    agent.save()

#Create Venue
#Venue name, photo of venue, address of venue
for data in [[
        'Chatfield Park',
        hmod.Photograph.objects.get(id=1),
        hmod.Address.objects.get(id=6)
],
             [
                 'Pinkerton Park',
                 hmod.Photograph.objects.get(id=1),
                 hmod.Address.objects.get(id=2)
             ]]:
    venue = hmod.Venue()
    venue.name = data[0]
    venue.photo = data[1]
    venue.address = data[2]
    venue.save()

#Create Event
#name, start day, end day, map file, public?, venue
for data in [[
        'Colonial Days', '2015-01-10', '2015-01-15', 'map.html', True,
        hmod.Venue.objects.get(name='Chatfield Park')
],
             [
                 'Festival of the Past', '2015-04-15', '2015-04-20',
                 'map.html', True,
                 hmod.Venue.objects.get(id=2)
예제 #6
0
파일: initdb.py 프로젝트: rodcox89/chf
        'The great saltair',
        'Old open warehouse at the edge of the great salt Lake', '55 e I-80',
        'Magna', 'Utah', '84667'
    ],
    [
        'Scera Parl',
        'Awesome ampitheatre seats close to 4000 people, great for movies',
        '800 north state street', 'Orem', 'Utah', '84664'
    ],
    [
        'Jordan towns', 'Has a splashpad for kids, with a nice barbeque pit',
        '455 e main', 'Springville', 'Utah', '84661'
    ],
]:

    v = hmod.Venue()
    v.name = data[0]
    v.description = data[1]
    v.address = data[2]
    v.city = data[3]
    v.state = data[4]
    v.zip_code = data[5]

    v.save()
    print(v)

###############################rentals###############################

#Delete old rentals
hmod.Rentals.objects.all().delete()