diff options
author | ashwinishinde | 2015-03-18 14:46:34 +0530 |
---|---|---|
committer | ashwinishinde | 2015-03-18 14:46:34 +0530 |
commit | 2e4a5f239283af883532e367bdb9d81c2c311f1c (patch) | |
tree | 8baf9fb9c634622cdf1b85d70ac4764f09946ad0 /populate_issue.py | |
parent | 130bb98ed8876aa48c94d98650729f6662024db1 (diff) | |
download | FOSSEE-Forum-2e4a5f239283af883532e367bdb9d81c2c311f1c.tar.gz FOSSEE-Forum-2e4a5f239283af883532e367bdb9d81c2c311f1c.tar.bz2 FOSSEE-Forum-2e4a5f239283af883532e367bdb9d81c2c311f1c.zip |
Subject:FOSSEE forum registration and category
Description:
1) Registartion
2) added fossee category
3) removed Issues
4) removed Tutorials
5) resolve MyQuestion and MyAnswer Uid problem
Diffstat (limited to 'populate_issue.py')
-rw-r--r-- | populate_issue.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/populate_issue.py b/populate_issue.py new file mode 100644 index 0000000..8ea103c --- /dev/null +++ b/populate_issue.py @@ -0,0 +1,24 @@ +import os +import datetime +from datetime import timedelta + +Date = datetime.datetime.now() +def populate(): + + f=open("issue_names.txt") + for line in f: + cname=line.replace("\n","") + cat_added=add_category(cname) + f.close() + +def add_category(cname): + cat = Issue.objects.get_or_create(name=cname,date_created=Date,date_modified=Date)[0]#for now description is same as category_names + print "category " +str(cname)+" added at "+str(Date) + return cat + +# Start execution here! +if __name__ == '__main__': + print "Starting population script for adding category..." + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'forums.settings') + from website.models import * + populate() |