def create(request): params = {} organization = hmod.Organization() organization.save() return HttpResponseRedirect('/administrator/organizations.edit/{}/'.format(organization.id))
def create(request): organization1 = hmod.Organization() organization1.given_name = 'New Organization' organization1.organization_type = '' organization1.creation_date = "2001-12-31" # ... other field defaults organization1.save() return HttpResponseRedirect('/homepage/organizations.edit/{}/'.format( organization1.photographablething_ptr_id))
]: photo = hmod.Photograph() photo.date_taken = data[0] photo.place_taken = data[1] photo.image = data[2] photo.caption = data[3] photo.save() #Create Organizations #name, organization_type, address_id for data in [[ 'Walmart', 'Retail', hmod.Address.objects.get(address_1='1478 Retail Dr.') ], ['Target', 'Retail', hmod.Address.objects.get(address_1='1478 Retail Dr.')]]: organization = hmod.Organization() organization.name = data[0] organization.organization_type = data[1] organization.address = data[2] organization.save() #Create Users #password, is_superuser, username, first_name, last_name, email, is_staff, birth_date, address_id, organization_id for data in [ [ 'password', True, 'SuperUser', 'Robert', 'Hoeft', '*****@*****.**', True, '1991-12-27', hmod.Address.objects.get(id=1), None ], [ 'password', False, 'AdminUser', 'Devin', 'Adams',
i1 = hmod.Item() i1.name = "Musket" i1.description = "A colonial era musket. Uses gun powder." i1.value = 135 i1.standard_rental_price = 18.75 i1.save() i2 = hmod.Item() i2.name = "Waistcoat" i2.description = "A replica of George Washington's waistcoat as he crossed the Delaware." i2.value = 35 i2.standard_rental_price = 4.95 i2.save() ## Organizations: org1 = hmod.Organization() org1.given_name = "Colonial Heritage Foundation" org1.organization_type = "Non-profit Organization" org1.creation_date = "2007-01-09" org1.save() org2 = hmod.Organization() org2.given_name = "Brigham Young University" org2.organization_type = "Educational" org2.creation_date = "2001-01-01" org2.save() ## Areas: area1 = hmod.Area() area1.name = "Declaration Signing Room" area1.description = "A display of the room that the Declaration of Independence was signed in."