Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Have an /admin/smuggler/ page #30

Open
pconerly opened this issue Aug 15, 2014 · 8 comments
Open

Have an /admin/smuggler/ page #30

pconerly opened this issue Aug 15, 2014 · 8 comments

Comments

@pconerly
Copy link
Contributor

So. I have a many-to-many relationship, and I obsfucate the through model from the django admin, b/c my coworkers don't need to see it.

I'd like to be able to replicate our production data into our staging / QA / dev environments. So there are three specific models I need to download the data from.

It'd be awesome if there were a general smuggler page. Something that would just list all apps and models, and you could check boxes for what you want to dump, and then a "dump" button.

/auth
/djcelery
/app
  /unimportant model
  /unimportant model 2
  X article
  X group
  X group-article
/app2
  /foo
  /bar

@semente what are your thoughts about a feature like this?

Is there some easy way I can overload a dump() call to give me 3 specific models, so I can at least hack a solution for myself?

@jaap3
Copy link
Collaborator

jaap3 commented Aug 15, 2014

More control over what gets dumped would be great, I think. Smuggler reuses the dumpdata code mostly, so anything possible with that command should theoretically be possible.

@semente
Copy link
Owner

semente commented Aug 15, 2014

I do like your idea! :)

Not sure but I think smuggler.views.dump_to_response already accept a list of apps/models, so we just need create a new view that receive a app label list as GET parameter (e.g. /admin/smuggler/?app_labels=myapp.model1,myapp.model2).

We could start with this view without any page, so you can do what you want by typing the apps you need directly from the URL bar of your browser. Later we take care about a interface for this.

What do you think guys?

@pconerly
Copy link
Contributor Author

Yup, the new view with those query params would be good enough for me use.

If I wrote that feature, could we cut a pypi release within a week?

Also yeah, dumpdata can accept a list of app or app.model.

@semente
Copy link
Owner

semente commented Aug 15, 2014

Yes, I think we can release it within a week.

And thank you for your help!

@jaap3
Copy link
Collaborator

jaap3 commented Aug 21, 2014

Just released smuggler-0.5. Thanks for your contribution and waking up the project :)

Are you planning to create a page, for a future version of smuggler?

@semente
Copy link
Owner

semente commented Aug 21, 2014

Thanks @jaap3 for make a new release. I was about to do that this morning. Too busy here, sorry. :/

@pconerly
Copy link
Contributor Author

Yeah, I would still like to make an actual page in the future. I'd probably extend off of an Admin page and give it an "export" action. I'm going to see how I like the url-only strategy for now and then prioritize the page based on that.

@pconerly
Copy link
Contributor Author

Also, w00t for the 0.5 release!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants