New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made carousel tags thread-safe #4
Conversation
ça ne marche pas, les logos ne défilent pas sur la frontpage 😞 |
99d0de2
to
cb60927
Compare
En local (et sur testing) c'est normal: on a les a viré de la base de données. Tu peux essayer en en rajoutant depuis le backoffice django. |
@register.tag('carousel') | ||
def do_carousel(parser, token): | ||
@register.inclusion_tag('carousel/templatetags/carousel.html', name='carousel') | ||
def do_carousel(carousel, max_items=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On peut renommer la fonction en carousel
simplement (et les suivantes aussi) pour éviter de devoir spécifier un nom?
Je centraliserais la logique de D'ailleurs a y réfléchir, les fonctions |
cb60927
to
1338797
Compare
je sais pas trop comment ça marche l'héritage de tags, c'est quel format qu'il faut pour les logos? |
Il n'y a pas d'héritage a proprement parler: ce sont juste des fonctions qu'on utilise:
Pour les logos, n'importe quelle image devrait suffire. |
1338797
to
fa39653
Compare
🆙 |
return CarouselNode(object=carousel, max_items=max_items) | ||
elements = carousel.get_elements() | ||
if max_items is not None: | ||
elements = list(elements)[:max_items] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too much indentation (should be 4 spaces)
Refs m2bpo/espadon#49
fa39653
to
d144c29
Compare
Made carousel tags thread-safe
Refs m2bpo/espadon#49