Пример #1
0
    def get_discussion(id):
        response = []

        attrs = DDiscussion.load(id)
        if attrs != None:
            disc = EDiscussion().create_from_attributes(attrs)
            response.append(disc.__dict__)

        return json.dumps(response)
Пример #2
0
	def get_discussion(id):
		response = []

		attrs = DDiscussion.load(id)
		if attrs != None:
			disc = EDiscussion().create_from_attributes(attrs)
			response.append(disc.__dict__)

		return json.dumps(response)
Пример #3
0
	def list_discussion(params):
		response = []
		opt = {}

		for i in ALLOWED_PARAMS:
			if i in params:
				opt[i] = params[i].lower()

		discussions = DDiscussion.load_many(opt)
		if len(discussions) > 0:
			for d in discussions:
				response.append(EDiscussion().create_from_attributes(d).__dict__)
		
		return json.dumps(response)
Пример #4
0
    def list_discussion(params):
        response = []
        opt = {}

        for i in ALLOWED_PARAMS:
            if i in params:
                opt[i] = params[i].lower()

        discussions = DDiscussion.load_many(opt)
        if len(discussions) > 0:
            for d in discussions:
                response.append(
                    EDiscussion().create_from_attributes(d).__dict__)

        return json.dumps(response)
Пример #5
0
 	def save_message(disc):
 		msg = EDiscussion().create_from_discussion(disc)
 		print msg.__dict__
 		DDiscussion.save(msg)
Пример #6
0
 def save_message(disc):
     msg = EDiscussion().create_from_discussion(disc)
     print msg.__dict__
     DDiscussion.save(msg)