diff options
Diffstat (limited to 'servicios')
-rw-r--r-- | servicios/xmlrpc.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/servicios/xmlrpc.py b/servicios/xmlrpc.py index 995911c..51e2b68 100644 --- a/servicios/xmlrpc.py +++ b/servicios/xmlrpc.py @@ -7,7 +7,7 @@ from SimpleXMLRPCServer import SimpleXMLRPCDispatcher from django.http import HttpResponse -from elgarito.blog.models import Articulo +from blog.models import Articulo dispatcher = SimpleXMLRPCDispatcher(allow_none=False, encoding=None) @@ -32,7 +32,7 @@ def rpc_handler(request): for method in methods: sig = dispatcher.system_methodSignature(method) - help = dispatcher.system_methodHelp(method) + help = dispatcher.system_methodHelp(method) response.write("<li><b>%s</b>: [%s] %s</li>" % (method, sig, help)) response.write("</ul>") @@ -40,6 +40,7 @@ def rpc_handler(request): response['Content-length'] = str(len(response.content)) return response + def articulos_blog(max=10): """ Devuelve los Ășltimos artĂculos del blog. Admite un argumento, que indica el @@ -49,10 +50,10 @@ def articulos_blog(max=10): lista = [] for a in articulos: lista.append({ - "titulo" : a.titulo, - "autor" : a.autor.username, - "created_on" : a.created_on.__str__(), - "texto" :a.texto + "titulo": a.titulo, + "autor": a.autor.username, + "created_on": a.created_on.__str__(), + "texto": a.texto }) return lista dispatcher.register_function(articulos_blog, 'articulos_blog') |