<s> import json <EOL> __author__ = '<STR_LIT>' <EOL> from google . appengine . ext import db <EOL> from models . User import User <EOL> class Project ( db . Model ) : <EOL> projectName = db . StringProperty ( required = True ) <EOL> courseId = db . IntegerProperty ( required = True ) <EOL> master_id = db . IntegerProperty ( required = True ) <EOL> grade = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> logo_url = db . StringProperty ( required = False , default = None ) <EOL> gitRepository = db . StringProperty ( required = True ) <EOL> membersId = db . StringListProperty ( required = True ) <EOL> info = db . TextProperty ( required = False , default = "<STR_LIT:{}>" ) <EOL> def to_JSON ( self ) : <EOL> members = [ ] <EOL> for id in self . membersId : <EOL> members . append ( dict ( json . loads ( User . get_by_id ( int ( id ) ) . to_JSON ( ) ) ) ) <EOL> data = { '<STR_LIT>' : self . projectName , <EOL> '<STR_LIT>' : self . courseId , <EOL> '<STR_LIT>' : self . master_id , <EOL> '<STR_LIT>' : self . grade , <EOL> '<STR_LIT>' : self . logo_url , <EOL> '<STR_LIT>' : self . gitRepository , <EOL> '<STR_LIT>' : members , <EOL> '<STR_LIT:info>' : json . loads ( self . info ) , <EOL> '<STR_LIT:id>' : self . key ( ) . id ( ) <EOL> } <EOL> return json . dumps ( data ) </s>
