indentation on session vars #358

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment Hide comment
@ebertti

ebertti Feb 26, 2013

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

ebertti commented Feb 26, 2013

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

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost 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 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

This comment has been minimized.

Show comment Hide comment
@ghost

ghost 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.

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.

@jezdez

View changes

tests/tests.py
@@ -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': {}, '''\

This comment has been minimized.

Show comment Hide comment
@jezdez

jezdez Mar 2, 2013

Member

Please use implied line continuation in strings as mentioned in PEP8

@jezdez

jezdez Mar 2, 2013

Member

Please use implied line continuation in strings as mentioned in PEP8

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Mar 2, 2013

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

ghost commented Mar 2, 2013

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

@aaugustin

This comment has been minimized.

Show comment Hide comment
@aaugustin

aaugustin Oct 27, 2013

Contributor

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

Contributor

aaugustin commented Oct 27, 2013

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

@aaugustin

This comment has been minimized.

Show comment Hide comment
@aaugustin

aaugustin Oct 27, 2013

Contributor

I have committed a simpler solution in 982f341.

Contributor

aaugustin commented Oct 27, 2013

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