Block auto-creation for blocks with hardcoded slugs. Some testing and distribution issues are fixed.#3
Conversation
Tests now can be executed using runtests.py without installing django-flatblocks to PYTHONPATH.
…n it will be auto-created. Also refactored tests a bit to make use of django's transactional test case. It is faster and easier than manual cleanups and unittest.TestCase.
|
Thank you :-) I will try find some time for it in the next couple of days but it sounds reasonable. I kind of remember having something like this around in some early version (that perhaps never ended up on github) but apparently somehow got lost :-) |
|
That's great :) |
|
Just find some time and looked through your changes. If nothing comes up I'll try to build a new release tomorrow or on Tuesday (evening is already filled with stuff ;-)). I just undid some of your changes to the unittests since I still want to support 1.1 with this package. I've added another testrunner for that. I'm also still considering adding a setting for the block autocreation since it is still kind of not backwards-compatible behaviour. |
|
Thanks! |
|
0.4.0 now includes the autocreation as well as the FLATBLOCKS_AUTOCREATE_STATIC_BLOCKS settings (default False for backwards-compatibility reasons). Thank you again :-) |
Hi Horst,
I've made several changes and they are ready for your review.
If block slug is hardcoded in template it is convenient to auto-create the block.
Before my changes if I want to add a block then the following changes must be performed:
It is easy to mismatch slugs.
With this change I can add block to template, push changes - and staff is ready to modify the content. I don't think this feature can be abused because blocks with variable names are not auto-created.