Admin hstore widget

278 views
Skip to first unread message

Curtis Maloney

unread,
Feb 7, 2016, 6:11:46 PM2/7/16
to django-d...@googlegroups.com
So, I've been working on https://code.djangoproject.com/ticket/25197

I have it as part of my own project, with a view to contributing to core
once it's polished.

Currently it has basic functionality - a JS widget that fires on load,
hides the textarea, and produces a table of (name, value, actions).

It records original values for existing keys, so you can "undo" your
changes. And I'm just adding detection of duplicate keys.

I also hope to add a "soft delete" so you can mark a key for deletion,
instead of immediately discarding it...

However, I've run into two problems:

1. I'd like more input on the features people feel are essential.

2. Is there a guide somewhere to styles and markup to be used in admin
templates?

3. I plan to pull in another icon from FA, but it appears the one we
currently use for "inline delete" is customised from the original. Does
anyone know who made these changes and how?

--
Curtis

Tim Graham

unread,
Mar 7, 2016, 10:43:36 AM3/7/16
to Django developers (Contributions to Django itself)
1. Merging something minimal always help to get feature requests. :-)

2. Could you be more specific about what you're looking for? All the existing documentation for style related stuff is at https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/. I also thought of ticket https://code.djangoproject.com/ticket/14831.

3. GitHub alias "elky" did the new admin look for 1.9: https://github.com/elky/django-flat-theme. I didn't verify the edits came in from that change, but what does "git blame" say?

Curtis Maloney

unread,
Mar 7, 2016, 4:18:59 PM3/7/16
to django-d...@googlegroups.com


On 08/03/16 02:43, Tim Graham wrote:
> 1. Merging something minimal always help to get feature requests. :-)



> 2. Could you be more specific about what you're looking for? All the
> existing documentation for style related stuff is at
> https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/.
> I also thought of ticket https://code.djangoproject.com/ticket/14831.

This is no way covers the HTML or CSS structures used in admin.

Given the deafening roar of absolutely no interest in this feature, I
guess I'll drop it.

--
C

Josh Smeaton

unread,
Mar 7, 2016, 5:57:35 PM3/7/16
to Django developers (Contributions to Django itself)
I wouldn't drop it if I were you. I (think) I watched you demo the hstore admin field at melbdjango and it looked cool to me. If I used hstorefield I'd be interested in the implementation. The dev ML isn't really indicative of the broader django community I feel, because only a small portion of the community seem to participate. Deafening silence here may still lead to cheers elsewhere once it's available. 

If I were you, I'd make a small screencast/gifv of the feature in action, reach out to some people that you know are using contrib.postgres (starting with Marc), and explicitly solicit their feedback on usefulness. If you still don't feel there is a real desire to have in core, could you release it as a 3rd party project? If it requires hooks in core to support custom fields then push those changes through separately.

My 2c :)

Marc Tamlyn

unread,
Mar 8, 2016, 4:48:04 AM3/8/16
to django-d...@googlegroups.com
Doing something better with the admin hstore is definitely something I'd like to see land.

1. I'd like more input on the features people feel are essential.
Something that allows you to add/change/delete keys is all you need to start with. Features like soft delete can be added later.


2. Is there a guide somewhere to styles and markup to be used in admin templates?
No, in short. Keep it simple seems to be the best advice I can give - most of the code is very old.


3. I plan to pull in another icon from FA, but it appears the one we currently use for "inline delete" is customised from the original.  Does anyone know who made these changes and how?
No idea sorry.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f6144212-cdde-4729-9d42-3d79397079ed%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Curtis Maloney

unread,
Mar 8, 2016, 5:41:06 AM3/8/16
to django-d...@googlegroups.com


On 08/03/16 20:47, Marc Tamlyn wrote:
> Doing something better with the admin hstore is definitely something I'd
> like to see land.
>
> 1. I'd like more input on the features people feel are essential.
> Something that allows you to add/change/delete keys is all you need to
> start with. Features like soft delete can be added later.

OK, well, I'll pare down the code and make a PR soon.

> 2. Is there a guide somewhere to styles and markup to be used in admin
> templates?
> No, in short. Keep it simple seems to be the best advice I can give -
> most of the code is very old.

So nobody understands the HTML and CSS used in Admin?

Someone must, since there are a few skins for it, and someone just redid
our skin for 1.9...

> 3. I plan to pull in another icon from FA, but it appears the one we
> currently use for "inline delete" is customised from the original. Does
> anyone know who made these changes and how?
> No idea sorry.

I had hoped the person "git blame" showed was reading this list... oh well

--
C

Marc Tamlyn

unread,
Mar 8, 2016, 6:05:53 AM3/8/16
to django-d...@googlegroups.com
I wouldn't say nobody understands it, Elky in particular will have a good working knowledge given he wrote the 1.9 skin. That doesn't mean there's a set of rules it follows. We certainly don't follow any particular front end standard such as BEM for class names. I'm pretty sure it's only a year ago a completely raw JS widget was rewritten with jQuery.



--
C

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
Reply all
Reply to author
Forward
0 new messages