Django

Code

Ticket #3799 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

Lorem ipsum template tag

Reported by: Sascha Peilicke Assigned to: adrian
Milestone: Component: Template system
Version: SVN Keywords: Lorem ipsum, Template, Debug mode
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Hello, everybody knows the "Lorem ipsum ..." text usually used to test templates. Wouldn't it be good to have a django built-in variable which displays this text. I have to test lots of templates and pasting this text in and deleting later is silly work. You could use it if you declare some blocks in your "base.html" and fill them with "Lorem ipsum" per Default, so that everybody can see how a template looks and works. I think it would be best if this placeholder is only displayed in DEBUG-mode.

here is an example of what i mean:

<body>

{%block content %}{{ placeholder }}{{% endblock %}

</body>

instead of

<body>

{%block content %}content goes here{{% endblock %}

</body>

Attachments

lorem_ipsum.patch (10.4 kB) - added by SmileyChris on 03/27/07 20:15:44.
with tests and docs

Change History

03/24/07 13:58:42 changed by Gary Wilson <gary.wilson@gmail.com>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs changed.

FYI, there is a Lorem ipsum template tag posted on djangosnippets.org.

03/27/07 17:30:02 changed by adrian

  • stage changed from Design decision needed to Accepted.

I love it!

03/27/07 20:15:44 changed by SmileyChris

  • attachment lorem_ipsum.patch added.

with tests and docs

03/27/07 20:16:29 changed by SmileyChris

  • stage changed from Accepted to Ready for checkin.

03/27/07 20:17:58 changed by SmileyChris

  • has_patch set to 1.

Sounded fun, so I did it. Doesn't currently do the "only displayed in DEBUG-mode." request, so push it back if this was part of accepted decision.

03/29/07 06:13:20 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(In [4847]) Fixed #3799 -- Added Lorem template tag for generation of random latin content. Thanks to SmileyChris? for the implementation.

03/29/07 06:43:24 changed by russellm

(In [4848]) Fixes #3799 -- Oops - ran last checkin from the wrong directory. Checked in the rest of the lorem templatetag implementation.

03/29/07 09:20:35 changed by anonymous

Still missing django.utils.lorem_ipsum

03/29/07 09:33:46 changed by Sascha Peilicke

Thanks everybody, exactly what I wanted

(follow-up: ↓ 12 ) 03/29/07 16:02:21 changed by SmileyChris

  • status changed from closed to reopened.
  • resolution deleted.

Doesn't look like django.utils.lorem_ipsum was checked in. Can a committer fix this please?

03/29/07 17:18:28 changed by adrian

I'd prefer this tag to be in django.contrib rather than being a built-in tag. It's nice, but it's not fundamentally necessary. I'll make that change.

(follow-up: ↓ 13 ) 03/29/07 17:39:56 changed by adrian

Just an FYI for SmileyChris?: In the attached patch, some of the functions in the lorem_ipsum.py module define variables whose names are the same as the functions themselves. Although it works, it's kinda sketchy, so I'm changing the internal variable names.

(in reply to: ↑ 9 ) 03/29/07 18:33:45 changed by russellm

Replying to SmileyChris:

Doesn't look like django.utils.lorem_ipsum was checked in. Can a committer fix this please?

Bother. I didn't have a good night with this ticket... :-)

It looks like Adrian is picking up the ball on this one. I'll leave him to it.

(in reply to: ↑ 11 ) 03/29/07 20:36:41 changed by SmileyChris

Replying to adrian:

... define variables whose names are the same as the functions themselves. Although it works, it's kinda sketchy...

Thanks, I'll avoid that in the future.

03/29/07 20:50:07 changed by adrian

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [4857]) Fixed #3799 -- Added django.contrib.webdesign and moved 'lorem' template tag into there


Add/Change #3799 (Lorem ipsum template tag)




Change Properties
Action