Skip to content
This repository was archived by the owner on Dec 9, 2019. It is now read-only.

Block auto-creation for blocks with hardcoded slugs. Some testing and distribution issues are fixed.#3

Merged
6 commits merged intozerok:masterfrom
kmike:master
Sep 12, 2010
Merged

Block auto-creation for blocks with hardcoded slugs. Some testing and distribution issues are fixed.#3
6 commits merged intozerok:masterfrom
kmike:master

Conversation

@kmike
Copy link

@kmike kmike commented Sep 11, 2010

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:

  • add block to template
  • create block in DB (using admin or management command) on local machine
  • create block in DB (using admin or management command) on staging server
  • create block in DB (using admin or management command) on production server
  • push changes

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.

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.
@zerok
Copy link
Owner

zerok commented Sep 12, 2010

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 :-)

@kmike
Copy link
Author

kmike commented Sep 12, 2010

That's great :)

@zerok
Copy link
Owner

zerok commented Sep 12, 2010

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.

@kmike
Copy link
Author

kmike commented Sep 12, 2010

Thanks!

@zerok
Copy link
Owner

zerok commented Sep 14, 2010

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 :-)

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants