Commits

<mar...@gmail.com  committed 27974d9

2 corrections for the full functional example: decorated content_size with @classmethod and fixed the user lookup in ArbitraryDataHandler.read()

  • Participants
  • Parent commits 4de838b

Comments (0)

Files changed (1)

     exclude = ('id', re.compile(r'^private_'))
     model = Blogpost
 
+    @classmethod
     def content_size(self, blogpost):
         return len(blogpost.content)
 
     methods_allowed = ('GET',)
 
     def read(self, request, username, data):
-        user = User.objects.get(username)
+        user = User.objects.get(username=username)
 
         return { 'user': user, 'data_length': len(data) }
 }}}