ixc / python-edtf

MIT License
52 stars 19 forks source link

How to use properly in django? #29

Closed intrepidocabral closed 2 months ago

intrepidocabral commented 6 years ago

note 1: yes, I read the article In which we get deeply nerdy about museum dates… note 2: It could be very useful a docs directory in this project, placing there a bunch of documentation about how-to-use that. I would like to contribute by that, please tell me how.

markfinger commented 6 years ago

Hi, sorry for the delay in response.

We don't really have designated people for maintaining this project and the original dev has left our organisation, so the project's been a bit dormant for a while. We're still using it in some large projects and back-porting fixes as we encounter issues though.

The project seems a bit directionless, so if you (or others) are interested and would like to contribute through issues+PRs, we're happy to accept whatever help is offered.


Anyway, I'll try to answer your questions as best I can (full disclosure, I've only hacked on small parts of the lib)...

What is the django version recomended? (LTS 1.11? 2.0+ ?) I installed and tryed into a django 2.0 project and, apparently, it works ok (initialy, we get no error log). But I'm not sure about a compliance tested version. Did you know?

I don't think it does anything that'd be an issue with 2+, so I'd expect it to work reasonably well with both 1.x and 2.x branches of django.

I was looking for django field type to store EDTF data. And more that, the first question here is how can I deal with EDTF in django models and django admin forms by extension? I already test python-edft in django and I got some exceptions and strange behaviors (incomprehensible ways of deal). Maybe this implementation could be more documented (I could do that, but before I would like to understand). Is there a simple way form to input extended data (level 1 and 2) by django admin and show that in a template? Maybe a better example (a more explicit one) could be useful.

I think the extent of the django integration is exposing an edtf field, so I don't think there's any real affordance for content-entry widgets/forms/etc: https://github.com/ixc/python-edtf/blob/ec2124d3df75f8dd72571026380ce8dd16f3dd6b/edtf/fields.py#L21

The workflow imagined by the original dev was that you have an EDTF field that accepts textual versions of dates, and it parses out earliest/latest thresholds to populate other fields. We've been using it populate things like date of birth for artists, date of creations for artworks, etc, in search engines.

How can a jornalist (non-tecnical person) be able to feed a form with edft data in a lazy way? Is there a problem with that aproach? What is your vision about that?

I'm not entirely sure what you mean here. By "lazy way", do you mean an easy way to enter content?

note 2: It could be very useful a docs directory in this project, placing there a bunch of documentation about how-to-use that. I would like to contribute by that, please tell me how.

Sure. We're more than happy to accept any PRs adding docs. As starters, maybe a "Getting Started" section that covers simply wiring things up.

aweakley commented 2 months ago

This is resolved by #56