Hi,
I have a vague idea to use OOP for a hyperlink.
A hyperlink has these attributes for me:
- href
- verbose name
- Permission: Is the current user allowed to follow the link?
- Preview (on-mouse-over tooltip)
I like Django because it handles the "href" part very smart (via reverse()).
My current use case is the preview tooltip.
The app I develop has roughly ten different report types.
I can't remember the name, but I can remember how the report looked like.
I recall the shape and colors of the report.
That's why I would like to have a on-mouse-over tooltip for the hyperlink.
For example look at these chart types: https://developers.google.com/chart/interactive/docs/gallery
The tooltip should show a small version of the report/chart if I move the mouse over the hyperlink.
I don't want to automate the creation of the preview images. It is enough if I am able to attach a small HTML snippet to
each Django-URL. This HTML snippet should be used for the preview tooltip.
What do you think?
Regards,
Thomas
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c1df4a33-d077-42c4-8fd0-94902b4fad69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c1df4a33-d077-42c4-8fd0-94902b4fad69%40googlegroups.com.
> <mailto:django-users+unsub...@googlegroups.com>.
Hi.Most probably you get there by creating custom template tag and bunch of other code.It would be easier to grasp your idea if you have some kind of an implementation to reference.Or is there something that stops you from proceeding?
I’ve been thinking about your idea, and I wonder if there could instead be some kind of widget for URL objects (or views).
--
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...@googlegroups.com.
To post to this group, send email to
django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b5c3f2db-f664-4855-a63c-349fb04d398f%40googlegroups.com.
I’ve been thinking about your idea, and I wonder if there could instead be some kind of widget for URL objects (or views).
Here’s Django’s documentation on widgets:
https://docs.djangoproject.com/en/2.0/ref/forms/widgets/
From the docs:
A widget is Django’s representation of an HTML input element.
This whole idea would take some time to implement and consider ramifications. After all, a hyperlink isn’t really an HTML input element.
You have urlpatterns being a list of url objects. If you could somehow take the attributes of the url object and copy them to a widget (through an __init__ method, for instance), and allow the user to customize those attributes in the URLWidget class. The really tricky thing about it, though, would be handling permissions.
I think it is a DRY way of handling the situation.
So the data comes from your urls file, where it is also stored. The input of the widget would be the url objects from the urls file.
From: django...@googlegroups.com [mailto:django...@googlegroups.com]
On Behalf Of guettli
Sent: Monday, April 30, 2018 2:25 AM
To: Django users
Subject: Re: Crazy Idea: OOP for "Hyperlink"
--
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...@googlegroups.com.
To post to this group, send email to
django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fd48e249-9d57-43f5-87e4-09bed383af62%40googlegroups.com.
> <mailto:django-users+unsub...@googlegroups.com>.