Browse Source

Radom small fixes

Marcos Dumay de Medeiros 7 years ago
parent
commit
758123f1fc
3 changed files with 10 additions and 9 deletions
  1. 7 6
      setup.py
  2. 3 2
      src/rapid/registry.py
  3. 0 1
      src/rapid/widgets.py

+ 7 - 6
setup.py

@@ -4,22 +4,23 @@ __author__ = 'marcos.medeiros'
 """
 
 # Always prefer setuptools over distutils
-from setuptools import setup, find_packages
+from setuptools import setup  # find_packages
 # To use a consistent encoding
 from codecs import open
 import os
 from os import path
 
+
 def _recursive_find(root, p):
     full_p = path.join(root, p)
-    for f in os.listdir(full_p):
-        full_f = path.join(full_p, f)
-        val_f = path.join(p, f)
+    for fl in os.listdir(full_p):
+        full_f = path.join(full_p, fl)
+        val_f = path.join(p, fl)
         if path.isdir(full_f):
             for ff in _recursive_find(root, val_f):
                 yield ff
         else:
-             yield val_f
+            yield val_f
 
 
 here = path.abspath(path.dirname(__file__))
@@ -81,7 +82,7 @@ setup(
     # your project is installed. For an analysis of "install_requires" vs pip's
     # requirements files see:
     # https://packaging.python.org/en/latest/requirements.html
-    install_requires=['django>=1.8', 'django-datetime-widget>=0.9', 'django-migration-fixture>=0.5', 'six'],
+    install_requires=['django==1.8', 'django-datetime-widget>=0.9', 'django-migration-fixture>=0.5', 'six'],
 
     # List additional groups of dependencies here (e.g. development
     # dependencies). You can install these using the following syntax,

+ 3 - 2
src/rapid/registry.py

@@ -157,11 +157,12 @@ class _Registry(object):
             raise Exception("Unidentified python module registering " + str(model))
         if module_name not in registry._modules:
             if Application.objects.filter(python_name=module_name):
-                registry._modules[module_name] = Application.objects.get(python_name=module_name)
+                a = Application.objects.get(python_name=module_name)
+                registry._modules[module_name] = ModuleEntry(a.python_name, a.name)
             else:
                 a = Application(name=module_name, python_name=module_name)
                 a.save()
-                registry._modules[module_name] = a
+                registry._modules[module_name] = ModuleEntry(a.python_name, a.name)
 
         module_entry = registry._modules[module_name]
         module_entry.models.add(model)

+ 0 - 1
src/rapid/widgets.py

@@ -132,7 +132,6 @@ def rapid_alternatives_widget(alternatives, selector):
     return RapidAlternativeFormsWidget
 
 
-#TODO: Finish it!
 def rapid_dependent_widget(model_data, form, has_instance, is_mutiple):
     class RapidDependentWidget(widgets.Widget):
         # What to ask: