django_builder icon indicating copy to clipboard operation
django_builder copied to clipboard

Old models never die

Open darkpixel opened this issue 5 years ago • 12 comments

I was signed in as an anonymous account. When I removed all my projects and created a new one with a new name, the old models populated the top of the screen.

darkpixel avatar May 24 '20 06:05 darkpixel

Hi @darkpixel Are these models you have imported from a models.py file? The imported models are not attached to particular project so they persist, they can be deleted from the import screen.

mmcardle avatar Jun 01 '20 19:06 mmcardle

Yeah, I imported them from a models.py file. There were literally somewhere around 300 models in this project. We basically introspected a 3rd-party database and we use Django to access the data. I was hoping to auto-generate a bunch of the boilerplate using django_builder, but it's forcing me to add every model by hand into an application. Maybe I'm missing something...

darkpixel avatar Jun 02 '20 22:06 darkpixel

Ah yes I see how that could be frustrating. To be honest I have only imported around 5 models max to test.

The flow is meant to be ->

  • Upload a models.py file, any models found appear in a bar along the top.
  • View the models in a dialog, choose which models to import and add the to an app.

What do you think would help in your situation (more than 1 might apply)

  • Add all models found automatically to an app?
  • Add "Add All" and "Delete All" buttons to the import dialog?
  • Remove all imported models from the dialog when you create a new project.

Thanks for your feedback

mmcardle avatar Jun 03 '20 07:06 mmcardle

Sorry--I'm not ignoring you. It's just been a busy couple of weeks.

I think those would all work, but I think it would be more efficient to upload directly to an app.

Basically models aren't a "project level" item. They are application level. When importing, they should probably be imported against an app directly without having to manually associate them.

I suppose someone might want to break things up into multiple apps, but I think that could be handled if necessary by being able to right-click a model and have an option to "copy/move to app" or something like that.

darkpixel avatar Jun 16 '20 01:06 darkpixel

That makes total sense, and would tidy up the UI quite a bit.

mmcardle avatar Jun 16 '20 14:06 mmcardle

@darkpixel this should now be fixed, there is an Upload button when adding a model to an app.

mmcardle avatar Jul 19 '20 10:07 mmcardle

Nice! I just checked out the live site. Would it be too much to ask to have an "Add All" button on the screen that comes up after uploading models? I want to load ~150 models, and don't want to keep clicking the "Add" button and waiting ~1 second for the page to refresh. :)

darkpixel avatar Jul 19 '20 22:07 darkpixel

@darkpixel Agreed and done.

mmcardle avatar Jul 23 '20 21:07 mmcardle

It spent several minutes trying to import a bunch of models, and tossed this into dev tools:

Screenshot from 2020-07-23 14-23-33

darkpixel avatar Jul 23 '20 21:07 darkpixel

@darkpixel Will see if i can fix that, might have to do them in batches. How many models and fields in total are you importing?

mmcardle avatar Jul 24 '20 16:07 mmcardle

196

darkpixel avatar Jul 24 '20 16:07 darkpixel

The issues with importing so many models is hitting the quota limits of the backend system (firebase). Currently the free tier has hard limits when you get to the quota https://firebase.google.com/pricing .

mmcardle avatar Sep 09 '20 09:09 mmcardle