summaryrefslogtreecommitdiff
path: root/servicios
diff options
context:
space:
mode:
authorJoaquín Aguirrezabalaga <kinote@kinote.org>2014-01-03 01:06:22 +0100
committerJoaquín Aguirrezabalaga <kinote@kinote.org>2014-01-03 01:06:40 +0100
commitf05c5e2d8a705df1c94b63a978267b291c893bbb (patch)
treea8bd95e9cc2c0bd48be57893ccc4ddec63152d29 /servicios
parent802a74102b9073e961ef1d7a487f99b962d76512 (diff)
downloadelgarito-master.tar.gz
elgarito-master.zip
django 1.6HEADmaster
Diffstat (limited to 'servicios')
-rw-r--r--servicios/xmlrpc.py13
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')