X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=engine%2Fmanifoldquery.py;h=ab09bfe7c84ec0dd750f0301d980f0d2036bca62;hb=a39d44883f3424d04134e4105873e88336b00795;hp=84ffc054cefc18e3c0a0987212069a0867ba720a;hpb=ba7cf8cf55b5d2c8c097ba896aa4443c866dbfec;p=unfold.git diff --git a/engine/manifoldquery.py b/engine/manifoldquery.py index 84ffc054..ab09bfe7 100644 --- a/engine/manifoldquery.py +++ b/engine/manifoldquery.py @@ -1,8 +1,8 @@ import json +import uuid -# xxx php has uniqid, need to find a module for that -counter=1 -def uniqid (): global counter; counter += 1; return counter +def uniqid (): + return uuid.uuid4().hex class ManifoldQuery: @@ -47,14 +47,12 @@ class ManifoldQuery: return """ new Query('%(a)s', '%(m)s', '%(t)s', %(f)s, %(p)s, %(c)s, %(unique)s, '%(uuid)s', %(aq)s, %(sq)s)"""%locals() - # 4amine - # xxx - # this should build an object from a dict as received from javascript - # to see an example just look at the server's output + # this builds a ManifoldQuery object from a dict as received from javascript through its ajax request + # e.g. here's what I captured from the server's output # incoming POST def fill_from_dict (self, d): for key in d.keys(): - for arg in ['action', 'method', 'filters', 'fields', 'timestamp', 'params']: + for arg in ['action', 'method', 'filters', 'fields', 'timestamp', 'params']: if arg in key: # dirty hack around fields; fields must be a list if arg == 'fields':