Sorry, i am a bit of a beginner at Django and Python.
I am following the contact form tutorial from chapter 7 of the new
book and instead of emailing the form contents i want to save it to a
database.
I referenced the model part from the main Django tutorial on the
website.
Ill have a look into
On Sun, Mar 22, 2009 at 3:57 PM, grimmus wrote:
>
> I am creating an instance of the model in a view like so:
>
> form = ContactForm(request.POST)
>if form.is_valid():
>cd = form.cleaned_data
>
>c = ContactEnquiry(cd['name'],cd['subject'],cd['email'],cd
> ['message
I am creating an instance of the model in a view like so:
form = ContactForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
c = ContactEnquiry(cd['name'],cd['subject'],cd['email'],cd
['message'],datetime.datetime.now())
c.save()
On Sun, Mar 22, 2009 at 3:00 PM, grimmus wrote:
>
> Hi,
>
> I have a class like so
>
> class ContactEnquiry(models.Model):
>name = models.CharField(max_length=100)
>subject = models.CharField(max_length=100)
>email = models.EmailField()
>message = models.CharField(max_length=100)
Hi,
I have a class like so
class ContactEnquiry(models.Model):
name = models.CharField(max_length=100)
subject = models.CharField(max_length=100)
email = models.EmailField()
message = models.CharField(max_length=100)
enquiry_date = models.DateTimeField('enquiry date')
def
5 matches
Mail list logo