Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty registered cruds list #52

Open
pavelber opened this issue Aug 10, 2017 · 4 comments
Open

Empty registered cruds list #52

pavelber opened this issue Aug 10, 2017 · 4 comments
Labels

Comments

@pavelber
Copy link

I tried to resemble your example with Person and PersonCrud but I get empty registered cruds list.

Should I explicitly register a crud in some way?

@catherinedevlin
Copy link

I am seeing the same problem.

@asifpy
Copy link
Owner

asifpy commented Nov 10, 2017

Where did you define your crud config classes?

  • All your crud config classes should go in module named crud (yourapp/crud.py)
  • App (with crud module) should be registered in settings.INSTALLED_APPS

@asifpy asifpy closed this as completed Nov 15, 2017
@jorgehatccrma
Copy link

I know this is closed, but the solution didn't solve the problem for me. I've checked that my app is in settings.INSTALLED_APPS and I've created my CRUD classes in myapp/crud.py. Anything else I should check?

@jorgehatccrma
Copy link

jorgehatccrma commented Dec 19, 2017

Digging into crudbuilder's source code, I think I found a possible cause. Apparently when using the Application Configuration features (see this SO post), crudbuilder can't find the app's path (in crudbuilder.registry.import_crud(app).

In my case, instead of declaring the raw name for my app (e.g. myapp) in INSTALLED_APPS, I have myapp.apps.MyappConfig (the default created by django 1.11 when following the tutorial). In other words:

INSTALLED_APPS = [
    # 'myapp',                  # I think this is what CRUDbuilder is expecting
    'myapp.apps.MyappConfig',   # This is what django automatically generates, but crudbuilder can't find the path in this case 
    ...
]

If I use the raw app name instead of the autogenerated line, then I see the registered cruds. It seems to me that, since the Application Configuration feature seems to be the prefered way to declare apps, crudbuilder should add support for this feature as well.

@asifpy asifpy reopened this Dec 20, 2017
@flaiming flaiming added the bug label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants