DescriptionThis is the first of a series of patches to remove the cyclic import
engine <-> models.
My first approach was just to move the constants to settings.py, but
it turned out that some more refactoring is needed to completely avoid
cyclic imports - and that it is a nice opportunity for some cleanups.
Here are the steps I'm about to do:
- Move FetchError to a new module codereview.exceptions (this patch).
- Move two helper functions ToText and UnifyLinebreaks to a new module
codereview.utils. Both are used in views.py and models.py too.
- Replace engine.FetchBase by models.Patch.fetch_base since that's the
only place where we actually need FetchBase. After this refactoring
engine.py should only be responsible for rendering.
- Move constants from engine.py to settings.py
- and finally clean up relative imports
I splitted the whole change to make it readable.
--
Andi
Patch Set 1 #
Total comments: 3
MessagesTotal messages: 5
|