def createNewProfile(firstName,lastName,username,email,password,phoneNumber, \
										address,sharezone,city,state,status,preferences_privacy):
	newProfile = Profile(user = User.objects.create_user(username,email,password), \
						phoneNumber = phoneNumber, streetAddress = address, sharezone = sharezone, \
						city = city, state = state, \
						status = status, preferences_Privacy = preferences_privacy)
	newProfile.user.first_name = firstName
	newProfile.user.last_name = lastName
	newProfile.user.save()
	newProfile.save()
	return newProfile
Example #2
0
 def save(self,commit = True):   
     user = super(UserRegistrationForm, self).save(commit = False)
     newProfile = Profile()
     newProfile.phoneNumber = self.cleaned_data['phone_number']
     newProfile.streetAddress = self.cleaned_data['street_address']
     newProfile.sharezone = self.cleaned_data['zip_code']
     newProfile.city = self.cleaned_data['city']
     newProfile.state = self.cleaned_data['state']
     newProfile.stateName = STATE_DICT[self.cleaned_data['state']]
     newProfile.emailNotifs = self.cleaned_data['email_notifications']
     newProfile.textNotifs = self.cleaned_data['text_notifications']
     newProfile.picture = ''
     newProfile.status = ''
     newProfile.reputation = 50
     newProfile.preferences = ''
     newProfile.timeCreated = timezone.now()
     if commit:
         user.save()
         newProfile.user = user
         newProfile.save()
     return user
Example #3
0
 def save(self, commit=True):
     user = super(UserRegistrationForm, self).save(commit=False)
     newProfile = Profile()
     newProfile.phoneNumber = self.cleaned_data['phone_number']
     newProfile.streetAddress = self.cleaned_data['street_address']
     newProfile.sharezone = self.cleaned_data['zip_code']
     newProfile.city = self.cleaned_data['city']
     newProfile.state = self.cleaned_data['state']
     newProfile.stateName = STATE_DICT[self.cleaned_data['state']]
     newProfile.emailNotifs = self.cleaned_data['email_notifications']
     newProfile.textNotifs = self.cleaned_data['text_notifications']
     newProfile.picture = ''
     newProfile.status = ''
     newProfile.reputation = 50
     newProfile.preferences = ''
     newProfile.timeCreated = timezone.now()
     if commit:
         user.save()
         newProfile.user = user
         newProfile.save()
     return user
    lastName = names[x][1]
    userName = firstName + lastName
    email = emails[x]
    pn = phoneNumbers[x]
    x = str(x)
    newProfile = Profile(user = User.objects.create_user(userName, email, 'password'), \
          phoneNumber = pn, streetAddress = '1 Lomb Memorial Drive', sharezone = '14623', \
          city = 'Rochester', state = 'NY', stateName = 'New York', \
          status = 'status')
    newProfile.user.first_name = firstName
    newProfile.user.last_name = lastName
    newProfile.user.save()
    if userName == "AlArujunan":
        newProfile.emailNotifs == False
        newProfile.textNotifs == False
    newProfile.save()
    profileObjects.append(newProfile)


shedNames = ["AlArujunan's Shed", "JakeDulin's Shed", "RoyCohen's Shed", "AlexBowen's Shed", "TaikhoomAttar's Shed", \
    "JacksonMcMahon's Shed", "AdamWalsh's Shed"]

shedObjects = []

for x in range(len(shedNames)):

    newShed = Shed(name=shedNames[x], owner=profileObjects[x], location=profileObjects[x].streetAddress + \
     ", " + profileObjects[x].city + ", " + profileObjects[x].state + " " + profileObjects[x].sharezone, \
        sharezone=profileObjects[x].sharezone, status='status')
    newShed.save()
    newShed.members.add(profileObjects[x])
	lastName = names[x][1]
	userName = firstName+lastName
	email = emails[x]
	pn = phoneNumbers[x]
	x = str(x)
	newProfile = Profile(user = User.objects.create_user(userName, email, 'password'), \
						 phoneNumber = pn, streetAddress = '1 Lomb Memorial Drive', sharezone = '14623', \
						 city = 'Rochester', state = 'NY', stateName = 'New York', \
						 status = 'status')
	newProfile.user.first_name = firstName
	newProfile.user.last_name = lastName
	newProfile.user.save()
	if userName == "AlArujunan":
		newProfile.emailNotifs == False
		newProfile.textNotifs == False
	newProfile.save()
	profileObjects.append(newProfile)

	
shedNames = ["AlArujunan's Shed", "JakeDulin's Shed", "RoyCohen's Shed", "AlexBowen's Shed", "TaikhoomAttar's Shed", \
				"JacksonMcMahon's Shed", "AdamWalsh's Shed"]

shedObjects = []

for x in range(len(shedNames)):

	newShed = Shed(name=shedNames[x], owner=profileObjects[x], location=profileObjects[x].streetAddress + \
		", " + profileObjects[x].city + ", " + profileObjects[x].state + " " + profileObjects[x].sharezone, \
					sharezone=profileObjects[x].sharezone, status='status')
	newShed.save()
	newShed.members.add(profileObjects[x])