diff options
author | prashantsinalkar | 2017-09-07 12:26:06 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-09-07 12:26:06 +0530 |
commit | 9f89e398c88fa0982363d5f42e10f04dc4b58911 (patch) | |
tree | f0b8bb2d7988c21ba56d00f025d4405e2a975fb0 /website/models.py | |
parent | a545b3f01d16d6dcaebe3067a2e847df7c271a59 (diff) | |
download | SciPy2017-9f89e398c88fa0982363d5f42e10f04dc4b58911.tar.gz SciPy2017-9f89e398c88fa0982363d5f42e10f04dc4b58911.tar.bz2 SciPy2017-9f89e398c88fa0982363d5f42e10f04dc4b58911.zip |
initial commit for development
Diffstat (limited to 'website/models.py')
-rwxr-xr-x | website/models.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/website/models.py b/website/models.py new file mode 100755 index 0000000..c8c9832 --- /dev/null +++ b/website/models.py @@ -0,0 +1,39 @@ +from django.db import models +from django.contrib.auth.models import User + +from social.apps.django_app.default.models import UserSocialAuth +from scipy2017 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 + return '%s/attachment/%s/%s.%s' % (instance.user, instance.proposal_type, fname+'_'+str(instance.user), fext) + +class Proposal(models.Model): + user = models.ForeignKey(User) + about_me = models.TextField(max_length=500) + email = models.CharField(max_length=128) + 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) + 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) + +class Ratings(models.Model): + proposal = models.ForeignKey(Proposal) + user = models.ForeignKey(User) + rating = models.CharField(max_length=700) + +class Comments(models.Model): + proposal = models.ForeignKey(Proposal) + user = models.ForeignKey(User) + comment = models.CharField(max_length=700) + # rate = models.CharField(max_length =100) |