Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Web - Open
drf-sqla
Commits
4792e897
Commit
4792e897
authored
Sep 16, 2014
by
Miroslav Shubernetskiy
Browse files
fix for hidden files
parent
9eeaf82b
Changes
1
Hide whitespace changes
Inline
Side-by-side
djangorest_alchemy/model_cache.py
View file @
4792e897
...
...
@@ -25,7 +25,7 @@ def module_walk(root_module, include_self=True):
path
=
os
.
path
.
abspath
(
path
)
for
file
in
files
:
if
not
file
.
rsplit
(
'.'
,
1
)[
1
]
==
'py'
:
if
not
file
.
rsplit
(
'.'
,
1
)[
-
1
]
==
'py'
:
continue
if
file
==
'__init__.py'
:
...
...
@@ -33,11 +33,15 @@ def module_walk(root_module, include_self=True):
file
=
os
.
path
.
join
(
path
,
file
)
file
=
file
.
replace
(
root_path
+
os
.
sep
,
''
)
file
=
file
.
rsplit
(
'.'
,
1
)[
0
]
if
'.'
in
file
:
continue
module_path
=
'.'
.
join
(
filter
(
None
,
root_module
.
__name__
.
split
(
'.'
)
+
file
.
rsplit
(
'.'
,
1
)[
0
].
split
(
os
.
sep
)
+
file
.
split
(
os
.
sep
)
))
module
=
importlib
.
import_module
(
module_path
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment