Skip to content

Instantly share code, notes, and snippets.

@santiagobasulto
Created November 17, 2011 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save santiagobasulto/1373179 to your computer and use it in GitHub Desktop.
Save santiagobasulto/1373179 to your computer and use it in GitHub Desktop.
# METODOS PARA AJAX
def ajax_get_subcategorias(request, id_categoria):
try:
padre = Categoria.objects.get(id = id_categoria)
categorias = padre.getSubcategorias()
json = serializers.serialize('json', categorias)
return HttpResponse(json, content_type='application/javascript; charset=utf-8')
except:
return HttpResponseNotFound()
<<<<<<< local
@login_required
def ajax_get_publicaciones_por_estado(request, estado_publicacion):
=======
def ajax_get_mis_publicaciones_por_estado(request, estado_publicacion):
>>>>>>> other
activas = Publicacion.objects.filter(estado=estado_publicacion, creador=request.user)
json = serializers.serialize('json', activas)
return HttpResponse(json, content_type='application/javascript; charset=utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment