Page MenuHomePhabricator

django form save method example

Authored By
adambcooley
Dec 27 2015, 4:20 AM
Size
1 KB
Referenced Files
None
Subscribers
None

django form save method example

class Registration(models.Model):
def __unicode__(self):
return str(self.id)
BusinessName = models.CharField("Business Name", max_length=100, null=True, blank=True)
FirstName = models.CharField("First Name", max_length=100)
LastName = models.CharField("Last Name", max_length=100)
Email = models.EmailField("Email")
Telephone = models.IntegerField("Telephone")
TextUpdate = models.BooleanField("Text Update", default=False)
Address1 = models.CharField("Address1", max_length=100)
Address2 = models.CharField("Address2", max_length=100, null=True, blank=True)
City = models.CharField("City", max_length=100)
State = models.ForeignKey(State, default="IA")
Zip = models.IntegerField("Zip Code")
Note = models.TextField("Note", max_length=500, blank=True)
Created = models.DateTimeField("Created", auto_now=True)
Updated = models.DateTimeField("Updated", auto_now_add=True)
profile_obj = Registration.objects.create(
content=content,
email=email,
)

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/vp/my/rkh2rfwxvlxmpvbo
Default Alt Text
django form save method example (1 KB)

Event Timeline