Anonymous avatar Anonymous committed 5a189a7

Comments (0)

Files changed (4)


         ret = dict()
         for field in fields:
-            if field in has:
+            if field in has and callable(field):
                 ret[field] = getattr(data, field)
         return ret
                     get_fields = set(fields)
-                get_fields_copy = copy.deepcopy(get_fields)
-                for reserved_field in ['read','update','delete','create']:
-                    get_fields_copy.discard(reserved_field)
-                met_fields = self.method_fields(handler, get_fields_copy)
+                met_fields = self.method_fields(handler, get_fields)
                 for f in data._meta.local_fields:
                     if f.serialize and not any([ p in met_fields for p in [ f.attname, ]]):


     def create(self, request):
         if request.content_type:
             data =
-            em = self.model(read=data['read'], create=data['create'])
+            em = self.model(read=data['read'], model=data['model'])
             return rc.CREATED


 class Issue58Model(models.Model):
     read = models.BooleanField(default=False)
-    create = models.CharField(max_length=1, blank=True, null=True)
+    model = models.CharField(max_length=1, blank=True, null=True)


     it make piston crash with a `TypeError`
     def init_delegate(self):
-        m1 = Issue58Model(read=True,create='t') 
+        m1 = Issue58Model(read=True,model='t') 
-        m2 = Issue58Model(read=False,create='f')
+        m2 = Issue58Model(read=False,model='f')
     def test_incoming_json(self):
-        outgoing = simplejson.dumps({ 'read': True, 'create': 'T'})
+        outgoing = simplejson.dumps({ 'read': True, 'model': 'T'})
         expected = """[
         "read": true, 
-        "create": "t"
+        "model": "t"
         "read": false, 
-        "create": "f"
+        "model": "f"
         # test POST
         resp ='/api/issue58.json', outgoing, content_type='application/json',
+        print resp.__dict__
         self.assertEquals(resp.status_code, 201)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.