Reputation: 87
Im trying to create a django model to get registration for newsletter , while creating model in model.py file im getting the following error
from __future__ import unicode_literals
from django.db import models
def SignUp(models.Model):
Email = models.EmailField(max_length=254, null = False , blank = False)
Name = CharField(max_length= 26, null = False , blank = False, default = 'datta')
TmieStamp = DateTimeField(auto_now=False, auto_now_add=True)
def __unicode(self)__:
return self.Name
The error:
Error:
File "C:\Users\DattaVamshi\Desktop\env\src\newsletter\models.py", line 7
def SignUp(models.Model):
^
SyntaxError: invalid syntax
error is in this line "def SignUp(models.Model):"
Pyhon 2.7, Django 1.9
Upvotes: 1
Views: 1133