google-code-export / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add some template tags #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
I've created some template tags for photologue. My idea was to use
photologue as a central repository of images which I then can reference in
any template with (for example):

{% get_rotating_photo 'splash-page-gallery' 'splash_page' 'splash_img' %}

The above example is taken from the splash page at
http://www.londonbellydancer.co.uk/ - each time the page loads, a photo is
picked at random from gallery 'splash-page-gallery'.

The library that I've written contains 2 tags - one loads a photo, the
other a photo from a gallery.
More detailed instructions on use are included in the source code for each tag.
The code is still a bit rough, for example the input could be made more
flexible, but I think that even in its current state it may be useful to
other people.

Let me know what you think!
Richard

Original issue reported on code.google.com by richardb...@gmail.com on 5 Mar 2008 at 11:47

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by justin.d...@gmail.com on 6 Mar 2008 at 3:23

GoogleCodeExporter commented 9 years ago

Original comment by justin.d...@gmail.com on 18 Mar 2008 at 3:04

GoogleCodeExporter commented 9 years ago
hello,

now I can see that the current template tag is named photologue, instead of the 
name
of this patch 'photologue_tag'.

This is a possible cause of bugs and strange behaivour as far as the most of 
the user
normally import photologue simply as photologue. As far as both names are the 
same,
the order to import it can be different and python can import photologue (the 
tag)
instead of photologue (the application), causing problems like:

AttributeError: 'module' object has no attribute 'models'

Because the photologue tag module doesn't have the models attribute, as 
obvious. I
think is a good practice to rename this tag to photologue_tag instead of this 
name.

Original comment by rober...@gmail.com on 5 Sep 2008 at 12:19

GoogleCodeExporter commented 9 years ago
I'll put this, along with expanded template tags on the list for 2.1.

Original comment by justin.d...@gmail.com on 5 Sep 2008 at 12:23

GoogleCodeExporter commented 9 years ago

Original comment by justin.d...@gmail.com on 17 Oct 2008 at 5:12

GoogleCodeExporter commented 9 years ago
I know this issue is quite a bit old, but I found myself needing this lately 
too.
Attached is an updated diff against the trunk, with necessary updates to work 
with
the trunk.

Original comment by xxf4n...@gmail.com on 20 Oct 2009 at 8:32

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by richardb...@gmail.com on 19 Sep 2012 at 8:32