Projet

Général

Profil

Bug #31092

Depuis la vue OU liste impossible de basculer sur l'édition d'une OU (django-tables2)

Ajouté par Emmanuel Cazenave il y a environ 5 ans. Mis à jour il y a environ 5 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
05 mars 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

Avec django-tables 1.21.2 qui vient après un pulik-devinst, marche pas. Marche avec 1.14.2 qu'on est censé avoir sur le SAAS (#31091).

Dans authentic2/manager/templates/authentic2/manager/ous.html :

{% block main %}
  {% with row_link=1 %}
      {% render_table table "authentic2/manager/table.html" %}
  {% endwith %}
  {% include "authentic2/manager/export_include.html" with export_view_name="a2-manager-ou-export" %}
{% endblock %}

Puis dans src/authentic2/manager/templates/authentic2/manager/table.html :

{% block table.tbody.row %}
<tr 
     {% if row_link %}
       {% if popup_edit %}
         rel="popup" 
       {% endif %}
       {% if url_name %}
         data-url="{% url url_name pk=row.record.pk %}" 
       {% else %}
         data-url="{{ row.record.pk }}/" 
       {% endif %}
     {% endif %}
     data-pk="{{ row.record.id }}" 

row_link pas dans le contexte du deuxième template en 1.21.1, pas de data-url.


Fichiers

Révisions associées

Révision 2741961e (diff)
Ajouté par Emmanuel Cazenave il y a environ 5 ans

access context through table object (#31092)

Révision df8cc6df (diff)
Ajouté par Valentin Deniaud il y a environ 5 ans

manager: access context through table object bis (#31222)

Related to #31092.

Historique

#1

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

Ça casse entre 1.20 et 1.21 :

+## 1.21.0 (2018-03-12)
+ - Add new method `paginated_rows` to `Table` to replace fallback to non-paginated rows in templates.
+ - Prevent mutation of the template context `{% render_table %}` is called from (fixes [#547](https://github.com/jieter/django-tables2/issues/547)

https://github.com/jieter/django-tables2/pull/550/commits/1a869f78c58c301003e0dfcd8577c4b111813595

#2

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

Le contexte est accessible sans trifouillage à travers l'objet table.

Testé en 1.2.0, 1.4.X, 1.21.2 et ok.

#3

Mis à jour par Frédéric Péters il y a environ 5 ans

En jessie on est encore sur une version 1.0.4 (mais une version 1.2.0 est disponible en backport, si utile).

#4

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

Pas pu tester en 1.0.4 parce que migration and co mais lecture du code ça me semble ok.

#5

Mis à jour par Thomas Noël il y a environ 5 ans

ack (si les tests passent)

#6

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

Ack deuz.

#7

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

  • Statut changé de Solution proposée à Résolu (à déployer)
commit 2741961ead7ef65a8e4d98e18d063dcaaf99de02
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Mar 5 13:31:32 2019 +0100

    access context through table object (#31092)
#8

Mis à jour par Frédéric Péters il y a environ 5 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF