diff options
author | Prashant S | 2018-08-23 17:26:48 +0530 |
---|---|---|
committer | GitHub | 2018-08-23 17:26:48 +0530 |
commit | 83e14c33bae4ef1ad5e8546408caf7232e962c75 (patch) | |
tree | 840a015b9bb62c4b7715212453f1235411f5efb1 /website/models.py | |
parent | b0b42e5553658fbd3aee833b555435a4401d208c (diff) | |
parent | 07c0150abaa36086cab2a0047125d7e0219f15b0 (diff) | |
download | SciPy2018-83e14c33bae4ef1ad5e8546408caf7232e962c75.tar.gz SciPy2018-83e14c33bae4ef1ad5e8546408caf7232e962c75.tar.bz2 SciPy2018-83e14c33bae4ef1ad5e8546408caf7232e962c75.zip |
Merge pull request #9 from prashantsinalkar/development
updated code according to pep8
Diffstat (limited to 'website/models.py')
-rw-r--r-- | website/models.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/website/models.py b/website/models.py index 7fa0bd6..3983dbf 100644 --- a/website/models.py +++ b/website/models.py @@ -5,36 +5,40 @@ from social.apps.django_app.default.models import UserSocialAuth from Scipy2018 import settings import os + def get_document_dir(instance, filename): # ename, eext = instance.user.email.split("@") fname, fext = os.path.splitext(filename) - #print "----------------->",instance.user + # print "----------------->",instance.user return '%s/attachment/%s/%s.%s' % (instance.user, instance.proposal_type, fname+'_'+str(instance.user), fext) + class Proposal(models.Model): - user = models.ForeignKey(User,on_delete=models.CASCADE,) + user = models.ForeignKey(User, on_delete=models.CASCADE,) about_me = models.TextField(max_length=500) email = models.CharField(max_length=128) - phone = models.CharField(max_length = 20) + phone = models.CharField(max_length=20) title = models.CharField(max_length=250) abstract = models.TextField(max_length=700) prerequisite = models.CharField(max_length=750) - duration = models.CharField(max_length = 100) + duration = models.CharField(max_length=100) attachment = models.FileField(upload_to=get_document_dir) date_created = models.DateTimeField(auto_now_add=True) date_modified = models.DateTimeField(auto_now=True) - status = models.CharField(max_length = 100, default='Pending', editable=True) - proposal_type = models.CharField(max_length = 100) - tags = models.CharField(max_length = 250) - open_to_share = models.CharField(max_length = 2, default=1) + status = models.CharField(max_length=100, default='Pending', editable=True) + proposal_type = models.CharField(max_length=100) + tags = models.CharField(max_length=250) + open_to_share = models.CharField(max_length=2, default=1) + class Ratings(models.Model): - proposal = models.ForeignKey(Proposal,on_delete=models.CASCADE,) - user = models.ForeignKey(User,on_delete=models.CASCADE,) + proposal = models.ForeignKey(Proposal, on_delete=models.CASCADE,) + user = models.ForeignKey(User, on_delete=models.CASCADE,) rating = models.CharField(max_length=700) - + + class Comments(models.Model): - proposal = models.ForeignKey(Proposal,on_delete=models.CASCADE,) - user = models.ForeignKey(User,on_delete=models.CASCADE,) + proposal = models.ForeignKey(Proposal, on_delete=models.CASCADE,) + user = models.ForeignKey(User, on_delete=models.CASCADE,) comment = models.CharField(max_length=700) # rate = models.CharField(max_length =100) |