New metadata values while using lookup choices

126 views
Skip to first unread message

Mike Hadmack

unread,
Mar 31, 2013, 4:15:25 AM3/31/13
to mayan...@googlegroups.com
Hi Everyone,

Is there a way to allow a metadata field accept the entry of a new string value AND present the user with a list of existing values from the database.  Since the metadata Lookup can execute python code it should be possible to generate a list of existing values as choices, but then I need to allow the user to add new choices to the list.  I am pretty new to Django so I don't know how much work would be involved in implementing this feature.  Can this all be accomplished by modifying DocumentCreateWizard?

Thanks,
Mike

Lau Llobet

unread,
Apr 5, 2013, 11:21:43 AM4/5/13
to Mayan EDMS
Hi Mike, I find this feature usefull. Although web browsers tend to place already used values to the textboxes while writing.

This solution solves the problems derived from having large lists of metadata, together with the solution proposed on the "metadata fixed values subsets to avoid long lists" e-mail It would make the metadata description more easy.

Both solutions require Java Script in the same web page in order to display this features. We could consider contacting a developer in order to do this client side coding (JS) while Mayan developers should do the server side. They also shoud check if the Puerto Rico laws about accesibility allow this features for disabled people usage. Maybe there's a flag on the web browser of the disabled person that can trigger the classic web view that's currently implemented.

Hope to hear from you,

Lau



--
 
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mike Hadmack

unread,
Apr 5, 2013, 9:05:24 PM4/5/13
to mayan...@googlegroups.com
Hi Lau,

I don't know that any JS would be required for this feature.  I don't think it would be difficult for the Mayan backend to query the database for a list of all metadata values and fill in a combo box.  In the case of a static set of metadata values this could be done by a function called from the "Lookup" property of the metadata type.  I think that the only complication is the addition of a text field beside the combo box that would allow for entry of new values.  This doesn't sound particularly complex but will require someone with much more Django knowledge than I.

-Mike

Lau Llobet

unread,
Apr 7, 2013, 7:14:36 AM4/7/13
to Mayan EDMS
Hi Mike , me and my partners have been talking about the problem of large sets of metadata when filling forms and the solution you are proposing. We consider it far mor usefull/simple/easy to implement than the one we proposed at "metadata fixed values subsets to avoid long lists" e-mail. Roberto found that past proposal was interesting, Roberto what dou you think about this new one ?

Greetings 

Lau.

Jason Priebe

unread,
Apr 9, 2013, 1:30:20 PM4/9/13
to mayan...@googlegroups.com
Mike:

This is an important feature for us, too.  It's pretty much a deal-breaker.  We can't have users all entering names inconsistently.  At least having a dropdown of suggested values would help bring some uniformity to the process.

I'm envisioning things working like this:
 - when defining the MetadataType, there is a boolean that indicates "enforce lookup"
 - if enforce_lookup is true, the form presents an HTML select field
 - if enforce_lookup is false, the form presents a text field, and it uses javascript to retrieve the lookup values as the user types  (you could use your technique of a select field and a text field, but that would be a little cumbersome for the user)

Then you could enter the python database code in the lookup field when you define the MetadataType.

I'm very close to trying to tackle this myself.  I really like Mayan in comparison to other products, but we really must have this feature (along with a couple of others).

Mike Hadmack

unread,
Apr 9, 2013, 1:59:59 PM4/9/13
to mayan...@googlegroups.com
Jason,

I'm glad I'm not alone in this.  Without this feature there will be too much fragmentation in the database to do any useful indexing.  If you do any development work on this can you share your fork?  I'd be happy to help out with it.

It would be nice to have an editable combobox with completion while typing but I think the only way to do this is with jQuery or a similar library.  In my deployment it will be important to have a complete list of options presented to the user.  I was also thinking of something like a "+" sign next to a static combobox to add a new item via a popup.  I'm not sure if HTML combo box option lists are mutable through JS though?

Another thing that is troublesome with metadata is the lack of datatypes.  I need to add a date field but it would be nice to have formatting validation and maybe a picker available, otherwise there will be no way to sort documents by data.

-Mike



You received this message because you are subscribed to a topic in the Google Groups "Mayan EDMS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mayan-edms/NuwHTS7LiYM/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to mayan-edms+...@googlegroups.com.

Jason Priebe

unread,
Apr 10, 2013, 8:27:09 AM4/10/13
to mayan...@googlegroups.com
I was looking at Django Selectable: https://bitbucket.org/mlavin/django-selectable, which uses jqueryui to build comboboxes and other auto-complete type fields.  Pretty nice.  But I haven't quite dug in deep enough to get this whole concept working.  I've never written python, and I obviously haven't messed with Django.  There's a rather steep learning curve.  If I knew what I was doing, it would probably be a 4-5 hour project.  Not knowing what I'm doing, it could take 30-40.  I'm still looking at other options for my document management, including SharePoint, which our IT staff uses a lot.  I'd prefer to use a standalone Linux system for this particular project, but right now I just need a solution quickly.

I totally agree on the typing -- having integers, dates, etc. would be very helpful.  

Also I'd love to see support for required vs optional metadata (I see that Roberto has some support for this in his code; it's just not working yet).

As long as I'm being wishful, I could imagine a full business rule system; maybe you would code the rules in python or something...

Mike Hadmack

unread,
Apr 10, 2013, 3:27:14 PM4/10/13
to mayan...@googlegroups.com
I am an experienced Python programmer, but I have only tinkered with Django a bit recently.  I've been through the tutorials and made a few small test applications so I understand the basic architecture and methodology of it.  The Mayan codebase is a little intimidating to me, though I'm sure that if I had time to get inside it and start making changes it will make sense.  I've never worked with JS or jQuery, but hopefully this is abstracted away in the package you mentioned.
The addition of datatypes doesn't seem too difficult.  Assuming that the type was only applied on metadata entry, you would just need to update the entry form to respect the type defined in the metadata type model.  Display could all be done as strings so I don't think much code would need to be changed.
Hopefully we will hear from Roberto on these ideas soon.

-Mike

Reply all
Reply to author
Forward
0 new messages