PiRSquared17 / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

[Patch] Make contrib.comments working with AEP #233

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
[[[
    Make contrib.comments working with AEP.

    * comments/models.py    using db.Model from appengine
    * others                using Query interface from appengine
]]]

What version of the product are you using? On what operating system?
 - tip mercurial version

Original issue reported on code.google.com by james.fa...@gmail.com on 21 Oct 2009 at 3:03

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for this, just testing it out now.

Original comment by harry.waye@gmail.com on 26 Oct 2009 at 2:00

GoogleCodeExporter commented 9 years ago
I had a little issue with using the get_comment_count tag.  Haven't looked in 
to it
at all, but getting an error saying count takes args and it wasn't given any.  
Should
get_comment_count work?

Original comment by harry.waye@gmail.com on 26 Oct 2009 at 2:29

GoogleCodeExporter commented 9 years ago
How much of this have you tested?  I have noticed a few things that are not 
working,
like Comment.get_absolute_url  Are you actively using the comments?

Original comment by harry.waye@gmail.com on 26 Oct 2009 at 7:33

GoogleCodeExporter commented 9 years ago
Sorry, i don't use the get_comment_cout tag and get_absolute_url.
I just want a quick and dirty guest book like featur, so i do not need those 
api 
(and did not patch them :( )
If you really want to make them work, here is the hints: if you look at my patch
or the diffs that AEP made to original django.contrib, they just change the 
django model
API to Google datastore API. So you can do this for the get_comment_count.(as 
far as
i know, there is not a SQL COUNT like function in Google Datastore API, but 
maybe you
can try this:
http://code.google.com/intl/en/appengine/docs/python/datastore/stats.html .) 
And for
the get_absolute_url, i guess you can make it work to by changing the django 
model id
to datastore key in the returning URL.
I did this patch for my personal project, but now i am trying to using
appengine-monkey to run Pylons. What make me choose django at first it's that in
Django i can use the whole lots of third party apps out there. But on App 
Engine,
those apps can not work out of box without patching their models layer.
Hope this would be helpful.

Original comment by james.fa...@gmail.com on 7 Nov 2009 at 7:05

GoogleCodeExporter commented 9 years ago
For comment counting to work (up to a limit of 1000, as per
http://code.google.com/appengine/docs/python/datastore/queryclass.html#Query_cou
nt)

contrib/comments/templatetags/comments.py must change in the def 
get_query_set(self,
context) method in the BaseCommentNode class.

It must return query and not return query.fetch(501)

Original comment by diederik...@gmail.com on 16 Mar 2010 at 8:05