Sorry about the example having bad syntax (doh!) -- I will get that fixed. I chose the public__ prefix because it makes it easier to introspect the supplied instance to find the methods intended to be public without forcing users of the class to provide a list themselves. You can put the class anywhere you want, I just stuck it in the view to keep it all together in the view. The RPC methods defined in that class are only used in that view.
And certainly the public__ prefix isn't any more unnatural than the ORM's query syntax. Ben On Jun 3, 10:33 am, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Wed, Jun 3, 2009 at 12:14 PM, BenW <benwil...@gmail.com> wrote: > > > I just posted a JSON-RPC handler I've been working with on the wiki: > > >http://code.djangoproject.com/wiki/Jsonrpc > > > I'd be interested in feedback from anyone doing async javascript with > > Django over RPC. > > > Thanks! > > > Ben > > a) This code can't possibly do anything other than raise a SyntaxError, > you're missing the apporpriate def statements. > b) There is 0 reason to define the class inside of the method in this > instance. > c) the public__ notation is horrific, use a decorator or something. > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." --Voltaire > "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---