Permalink
Browse files

Fixed allowed methods to () and few renames.

  • Loading branch information...
1 parent 1649ea2 commit 992f0ded02815c815ccd44616eeab6603634b3b5 @maticko maticko committed Apr 26, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 piplmesh/api/resources.py
View
8 piplmesh/api/resources.py
@@ -5,23 +5,25 @@
from piplmesh.account import models as account_models
from piplmesh.api import models as api_models
+#override dispatch_details ali pa post_detail / obj_create
+
class UserResource(resources.MongoEngineResource):
class Meta:
queryset = account_models.User.objects.all()
resource_name = 'user'
fields = ('username', 'is_online')
- allowed_methods = ('get',)
+ allowed_methods = ()
class CommentResource(resources.MongoEngineListResource):
- user = tastypie_fields.ForeignKey(to='piplmesh.api.resources.UserResource', attribute='user', full=True)
+ author = tastypie_fields.ForeignKey(to='piplmesh.api.resources.UserResource', attribute='author', full=True)
class Meta:
object_class = api_models.Comment
resource_name = 'comment'
class PostResource(resources.MongoEngineResource):
author = tastypie_fields.ForeignKey(to='piplmesh.api.resources.UserResource', attribute='author', full=True)
- comments = fields.EmbeddedListField(of='piplmesh.api.resources.CommentResource', attribute='comments')
+ comments = fields.EmbeddedListField(of='piplmesh.api.resources.CommentResource', attribute='comments', null=True)
class Meta:
queryset = api_models.Post.objects.all()

0 comments on commit 992f0de

Please sign in to comment.