12 |
|
|
13 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
14 |
# $Log$ |
# $Log$ |
15 |
|
# Revision 1.12 2004/09/17 09:42:30 xabbu |
16 |
|
# U function listItems() places a query to the server now and returns its results |
17 |
|
# |
18 |
# Revision 1.11 2004/09/15 22:27:06 xabbu |
# Revision 1.11 2004/09/15 22:27:06 xabbu |
19 |
# +/- function fraggleSync replaced by function syncTopics which places a query |
# +/- function fraggleSync replaced by function syncTopics which places a query |
20 |
# + function query has simple eval of error return code now |
# + function query has simple eval of error return code now |
96 |
def getTopicById(self, id): |
def getTopicById(self, id): |
97 |
return self.topics[id] |
return self.topics[id] |
98 |
|
|
99 |
def listItems(self,topicId): |
def listItems(self,contentkey): |
100 |
result = self.queryCms("GET creator_id, language_id, description FROM contents") |
result = self.queryCms(str("GET creator_id, language_id, description FROM contents WITH type "+contentkey)) |
101 |
#print result |
return result |
102 |
|
|
103 |
def queryCms(self,nqlquery): |
def queryCms(self,nqlquery): |
104 |
|
|
106 |
rpc = Server('http://netfrag.org/nfo/netfraggle.php') |
rpc = Server('http://netfrag.org/nfo/netfraggle.php') |
107 |
result = rpc.query(nqlquery) |
result = rpc.query(nqlquery) |
108 |
if result['0']['error'] == '0': |
if result['0']['error'] == '0': |
109 |
#print result |
#print result |
110 |
return result |
return result |
111 |
|
|
112 |
#else: |
#else: |
113 |
#print result['0']['error'] |
#print result['0']['error'] |
114 |
#return result |
#return result |