Closed marcoshemann closed 8 years ago
Error is saying that, drule
model of zabbix
app has already been registered, which means Drule
model is registered twice somehow.
Also please note that you need to place url(r'^', include('crudbuilder.urls')),)
in your root urls.py (where manage.py exist) and place your ModelCrud classes in your_app/crud.py (perfil/crud.py ---> for Proxy model, zabbix/crud.py ---> for Drule model).
Yes, organizing this way works very well. I use Python 3, and put url inside of app that have settings.py. Thanks.
yeah you are right main urls.py should be in same level as that of settings.py. In above I mentioned it wrongly (I said manage.py
instead of settings.py
)
I have this same structure cadastro/models.py /forms.py /views.py (here i define some view (BaseCrudBuilder): and work well /urls.py ( here is url(r'^', include('crudbuilder.urls')),) but if a create a view (BaseCrudBuilder): in other app like
perfil/view.py
class ProxyCrud(BaseCrudBuilder): model = Proxy search_feilds = ['nome'] tables2_fields = ('nome')
It dont create urls.. like /perfil/proxies...
If i create a same class ProxyCrud(BaseCrudBuilder): in cadastro.view show me a error:
crudbuilder.exceptions.AlreadyRegistered: Key 'zabbix-drule' has already been registered.