Monday, August 29, 2022

Uso de admin:%s_%s_changelist

Hola. Soy bastante inexperto en esto.  Necesito corregir esto:

def verpz(request,pk):

    myapplabel = Pozos._meta.app_label

    mymodelname = Pozos._meta.model_name

    infodata = myapplabel+'_'+mymodelname

   
   
    return HttpResponseRedirect(reverse("admin:%s_changelist" % infodata,args=(pk,)))

El objetivo es que en el administrador se muestre la lista de cambios filtrada, no todos los registros, si no solamente los que cumplan con alguna condición cómo por ejemplo que tengan una id específica.
Gracias por su colaboración.

Hello. I'm pretty inexperienced at this. I need to correct this:

def verpz(request,pk):

     myapplabel = Wells._meta.app_label

     mymodelname = Wells._meta.model_name

     infodata = myapplabel+'_'+mymodelname

   
   
     return HttpResponseRedirect(reverse("admin:%s_changelist" % infodata,args=(pk,)))

The objective is that the filtered list of changes is shown in the administrator, not all the records, but only those that meet some condition, such as having a specific id.
Thank you for your cooperation.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/061fe777-ec89-40c0-aa56-9261551116fdn%40googlegroups.com.

No comments:

Post a Comment