Would people who use this want our full-blown Django admin feature set? #88
Comments
Please leave comments here and tell me what's up. |
I think I would, assuming my Python/Django is up to the task. There's a lot of stuff involved in using the standalone TableStacker that is over non-programmers' heads, like YAML or running the script to bake and publish a table. It keeps them from accessing tools like this. The broader question is whether Table Stacker is, or could be, used by non-technical users. But right now, I doubt it is. |
One downside to the admin though is that you still have to write a little YAML to set the "column_options." That's because there is no way I know of in Django to set dynamic options, in this case based on the CSV uploaded by a user. The headline and information about the "table" as a whole are simple, but how you set options on a column-by-column basis (i.e. "What order should the columns go in?") aren't handled by any default Django options I know of. |
Sorry for the delay in responding. Been a little tied up with a newborn who just recently came home. I'm comfortable using TableStacker with the CLI, but one of my pipe dreams is to have it more accessible for everyone in the newsroom, particularly the folks on our continuous news desk who handle most of the day-to-day web production. For simple tables, I'd like for those folks to be able to publish themselves. How involved is the YAML in the admin setup? If it's along the lines of the formatting I'm already doing, it doesn't seem like an insurmountable hurdle. I've never worked with Celery, but I'm willing to learn if it would democratize this work a bit. Panel at NICAR? |
Basically, the extra setup is that you'd have to install Rabbit MQ's job server (sudo apt-get install rabbitmq-server) and Celery (pip install django-celery), which is a Django wrapper for it. What it does is create a job when you hit save in the admin that will bake out the changed pages and sync them up with S3 without the user knowing what's going on. |
You make it sound so simple. What's the admin YAML like? |
Basically, you still have to learn enough to do the columns:
- Collective
- Address
- Applied for lottery
- Ordered to close
style:
Collective: 'text-align:left; width:450px;'
Address: 'text-align:left;'
Applied for lottery: "text-align:center; width:150px;"
Ordered to close: "text-align:center; width:150px;"
sorted_by:
- Collective: ascending
formatting:
Applied for lottery:
method: bubble
Ordered to close:
method: checkbox
per_page: 500 |
Not ideal, but for folks comfortable in html, it's certainly doable with a wee bit of training. |
Yeah, it sucks. It's because there is no way I know of in Django to set dynamic options, in this case based on the CSV uploaded by a user. How you set options on a column-by-column basis (i.e. "What order should the columns go in?") is still an open challenge to me. If you have ideas how that could be admin-ified, let me know. |
I have no idea. I'm a Django neophyte, but I'll give it some thought. If I have any inspiration, I'll send them your way. |
In my pea-brain, it seems like you'd have to read the uploaded CSV and then create a configuration interface on the fly depending on the headers of the CSV. Or have a two-step upload-and-configure process. |
Jumping in here, but we've used (and loved) table-stacker at MinnPost, but it's always reporters sending me the csv, and I do the rest. I successfully taught one of our reporters the basic parts of the YAML file, and I agree that it isn't insurmountable for reporters/editors to learn this. A slick interface would be welcomed, though. Doesn't seem impossible. Worth it? Maybe. Either way, the Django admin interface would be great. |
I think a two-step process would work. Users will want to be able to customize the formatting for each column themselves, even if they don't want to write the code to do it. Is it possible to have an admin user upload a CSV, and the app would use CSVkit or another Python CSV module to read the column heads? Then, could you dump those column heads into a custom admin view and template that would let you choose the style, formatting and sorting from drop-down menus? |
Maybe that's the trick, some custom admin widget that like a wizard runs you through a series of popups or something, but which is secretly editing the YAML config underneath. |
Check that. Not like a wizard. Like a boss. Much better. |
Boss. I like that. On Jan 17, 2012, at 9:36 PM, Ben Welshreply@reply.github.com wrote:
|
It's a maybe. I can port our existing thing, with the in-admin YAML editing, and then we can try to figure it out. It sounds like something that's doable, but I've never done anything like it before. I think you'd need to write a goodly amount of JavaScript for a custom admin widget that would interact with the CSV file. Though how exactly you'd open it up I don't know yet. Because I don't think the CSV is posted to the database and available to the Python code until after you save the admin record for the first time. |
You could try to separate the CSV upload from the table's admin, maybe. Like make a CSV model where those are stored, and then the Table model has a Foreign Key linking to that. So that you'd have to fill out an inline or separately upload a CSV in another admin window before you could configure the public-facing table. Now, my system does all that in one model and with one admin. |
Another angle is you cut the CSV upload, and instead make a new magic widget that's a TextField. When CSV data is pasted in, it magically susses out all the columns and such, which could then be fed into the configuration |
That's a great idea. Reminds me in a way of MrDataConverter |
Advice on making that kind of magic JS box work? Basically, we'd need that but wired to a Django model field through the admin's widget framework. And then some JS in the change form would pop up a form that will fill out the column options, which would them have to be bound to the YAMLField containing that config. That second part could get pretty complicated too. It would have some complex forms to let you choose and order the columns, set CSS styles for selected columns somehow, pick and configure formatters, set a sort order, etc. |
Wow. I missed out on a lot of this debate! I think this is definitely the I wrote a bit of code to do some of what we're describing a few months |
I think I'll chime in for a 2-step process being a good way to go. And using a Web interface (Django admin or otherwise) is probably the only way to get non-developers on board. I wish it weren't but command line is probably always going to be a bridge too far for a certain segment. I was a Web designer for years without knowing any command line, though I shouldn't have been able to get away with it. |
I have some code I havn't merged in that would replace the text-editor and command-line style here with a Django admin that replaces the YAML and bakes your files up to S3 when you click save. It requires more setup (You need a Celery job server yet) and introduces a lot of complexity, but does it make it easier to get non-programmers using this thing.
The text was updated successfully, but these errors were encountered: