Skip to content

indentation on session vars #358

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

Closed
wants to merge 3 commits into from
Closed

indentation on session vars #358

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 25, 2013

I find SESSION vars difficult to read, especially when i use wizard forms.
To aerate this, i give a little template filter that indent dict...

@ebertti
Copy link

ebertti commented Feb 26, 2013

I like the idea, but don't think this is a good implementation...

@ghost
Copy link
Author

ghost commented Feb 26, 2013

your reply is unclear.
what do you think is bad : use a template filter?
give me direction if you want better...

@ghost
Copy link
Author

ghost commented Mar 2, 2013

i give a result example (a wizard session) with a unit test...
I think is a good way to prove what i want to do...

If my first commit is really a bad implementation, this test can validate a better work.

@@ -252,6 +256,88 @@ def test_queryset_hook(self):
self.assertIn('<<triggers database query>>', ctx)


class TemplateTagsTestCase(BaseTestCase):
def test_indent_dict(self):
input = '''{'step_files': {u'1': {}, u'0': {}, u'3': {}, '''\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use implied line continuation in strings as mentioned in PEP8

@ghost
Copy link
Author

ghost commented Mar 2, 2013

thanks jezdez : in fact, it's more beautiful!

@aaugustin
Copy link
Contributor

I prefer using the built-in pprint module, which — judging by the test in your patch — does pretty much the same thing.

@aaugustin
Copy link
Contributor

I have committed a simpler solution in 982f341.

@aaugustin aaugustin closed this Oct 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants