Commit Graph

65 Commits

Author SHA1 Message Date
Roberto Rosario
c4c2646b60 Add view to add or remove required metadata types to a document type, simplify existing view to add remove optional metadata types 2014-10-30 02:28:49 -04:00
Roberto Rosario
375de8270e Add manager class to handle the metadata types of a document type easily 2014-10-30 02:28:19 -04:00
Roberto Rosario
727ae0bea8 Add TODO reminder 2014-10-30 02:27:37 -04:00
Roberto Rosario
879f90547c Update metadata admin 2014-10-30 02:26:18 -04:00
Roberto Rosario
95a27df1e3 Change the way metadata types are associated to a document type, add required boolean field to the association 2014-10-30 02:24:12 -04:00
Roberto Rosario
eb878c165b Revert "Issue #56, #8, now that metadata types are automatically added to a document upon type change, there is no more need for the document metadata add and remove code, view, API"
This reverts commit c390fc21d7.

Re adding this feature, only required metadata should be automatically added, optional metadata would be added by the user
2014-10-29 20:17:19 -04:00
Roberto Rosario
3909d60e9a Issue #56, Remove child_views, child_urls, children_path_regex, children_view_regex link support 2014-10-28 17:41:10 -04:00
Roberto Rosario
9596beac79 Update translation messages sources 2014-10-28 17:21:37 -04:00
Roberto Rosario
2c2dfa88cc Issue #84, Remove template context variable 'object_name' to improve ease of translation 2014-10-28 02:36:43 -04:00
Roberto Rosario
c390fc21d7 Issue #56, #8, now that metadata types are automatically added to a document upon type change, there is no more need for the document metadata add and remove code, view, API 2014-10-28 02:16:53 -04:00
Roberto Rosario
6eb6c43807 Automatically the appropiate metadata types when the document's type is changed 2014-10-28 02:01:59 -04:00
Roberto Rosario
21d51accec Make sure the metadata being added is allowed 2014-10-27 23:21:13 -04:00
Roberto Rosario
0bed1df64a Issue #92, Make register_multi_item_links class aware 2014-10-27 19:21:05 -04:00
Roberto Rosario
a728690335 Issue #56, #97, Make multi item links a drop down list of actions, remove unused code 2014-10-27 16:26:13 -04:00
Roberto Rosario
20fb9dffbd Update translation sources 2014-10-25 02:50:31 -04:00
Roberto Rosario
71e8502614 Remove confirmation template's form icon 2014-10-25 02:21:44 -04:00
Roberto Rosario
1b0a3cbb71 Improve docstrings of existing metadata API endpoints and add endpoints to view, add and remove metadata types to document types 2014-10-23 11:38:03 -04:00
Roberto Rosario
e31d37ef09 Update source messages 2014-10-22 15:52:54 -04:00
Roberto Rosario
2ea48bd1ba PEP8 cleanups, further removal of unused code 2014-10-21 19:28:52 -04:00
Roberto Rosario
ce39a775ee Issue #88, remove metadata type selection step from interactive upload wizard
Max wizard steps is now 2. Second step is skiped when document type
has not associated metadata types.
2014-10-21 19:02:31 -04:00
Roberto Rosario
bc55a9e8cf Reduce title 2014-10-21 17:17:16 -04:00
Roberto Rosario
92c76d9f33 Issue #56, Remove Metadata Sets 2014-10-21 17:14:31 -04:00
Roberto Rosario
2441d232ab Issue #86, move south migrations from the 'migrations' to the 'south_migrations' directory 2014-10-21 13:23:05 -04:00
Roberto Rosario
2f01904217 Issue #56, remove boostrap app 2014-10-21 12:30:54 -04:00
Roberto Rosario
13f8bddeb2 Issue #56, Remove duplicate search feature 2014-10-18 02:37:04 -04:00
Roberto Rosario
6e3b62363e Solve issue #70 2014-10-13 17:16:14 -04:00
Roberto Rosario
a75a4edf21 Issue #39, Finish capitalizing source text messages 2014-10-10 02:29:37 -04:00
Roberto Rosario
9662d14e9c Issue #40, finish remaining '/' hardcoded redirects 2014-10-09 20:05:42 -04:00
Roberto Rosario
8bac1525be PEP8 cleanups 2014-10-08 19:39:16 -04:00
Roberto Rosario
50e143e754 Fix indentation 2014-10-08 18:15:19 -04:00
Roberto Rosario
97dcf507ab PEP8 cleanups 2014-10-08 18:14:05 -04:00
Roberto Rosario
379a34dabe Translation file synchronization 2014-10-08 17:31:51 -04:00
Roberto Rosario
ad7ae3dcfa Issue #56, Remove sidebar help templates and navigation function to register them 2014-10-08 10:11:04 -04:00
Roberto Rosario
78ecee7266 Merge branch 'gwalborn-master' into test
Conflicts:
	mayan/apps/metadata/forms.py
2014-10-07 13:47:02 -04:00
Roberto Rosario
6896b29b89 Merge branch 'master' of https://github.com/gwalborn/mayan-edms into gwalborn-master 2014-10-07 13:44:36 -04:00
Roberto Rosario
a85b3b1526 Add metadata app API endpoints 2014-10-07 08:57:37 -04:00
Roberto Rosario
74cf4c413f Import cleanups, reorganization, PEP8 cleanups 2014-10-02 02:01:08 -04:00
Roberto Rosario
06dd1b3368 Issue #39, Explicitly captalize string now that they are not capitalized blindly by the templates 2014-10-02 01:17:27 -04:00
Roberto Rosario
437c74a024 Merge branch 'master' into development 2014-10-01 05:19:51 -04:00
Ford Guo
fa78a30413 change zh_CN po mo 2014-09-30 11:00:39 +08:00
Ford Guo
5d10eab278 update zh_CN 2014-09-29 14:28:50 +08:00
Ford Guo
e4cdc69ca1 add zh_CN mo files 2014-09-26 13:54:49 +08:00
Ford Guo
b15100c2ea add zh_CN language 2014-09-26 11:43:53 +08:00
Gary Walborn
9cd3753746 Adds ability to validate and normalize metadata.
I felt that it would be very handy to be able to validate
user-supplied metadata.  It occurred to me that if a metadata
type had an explicit list of options, it would need no validation.
Therefore, the "lookup" field of a metadata type could be overloaded
to provide EITHER a list of items that could be selected by the user
OR a function to provide data validation.  The system, therefore,
would need to be able to discriminate between a lookup function
and a validation function.

    To this end, I created a global variable
('METADATA_AVAILABLE_VALIDATORS') to contain a dictionary of
available validation functions.  If the name specified in
'metadata_type.lookup' is present in METADATA_AVAILABLE_VALIDATORS,
the system treats the function as a validator.  Otherwise, the
function is treated as a generator of an iterable value providing
the choices for the user.

  Django contains a pre-existing mechanism to support field
validation.  A validator has a single argument (the data to
be validated).  If the argument to the validator is valid,
the validator simply returns.  If there is a problem with
the data, the validator raises a 'ValidationError' exception
and passes an error message which is then displayed by Django
as a mouseover tip in the browser. Validators to be used
with Mayan-EDMS may follow this convention (i.e., take a
single argument and raise an exception if the validation
fails).  The validators in Mayan-EDMS, however, may actually
do more!

  If a validator function RETURNS a value, that value is used
in place of the original data.  This allows the validator to
make data conform to a valid value or to "normalize" a value
before it is stored in the database.  This allows for more
uniform metadata and improves the ability to index on the
metadata values.  Lets take at a look at an example of this
functionality.

  Assume that a document requires a date (perhaps, an
"original posting date").  We can have a 'metadata_type" of
"original_posting_date", and we can create a validator with
the name "is_valid_posting_date".  The validator function
(which is placed in a module read by the settings routine),
contains the function:

def is_valid_posting_date(value):
   from dateutil import parser
   import datetime
   from django.core.exceptions import ValidationError

   try:
      dt = parser.parse(value)
   except ValueError:
      raise ValidationError('Invalid date')
   return dt.date().isoformat()

This is placed in a dictionary in the user's
settings file, thus:

import my_settings
METADATA_AVAILABLE_VALIDATORS = {
  'is_valid_posting_date':my_settings.is_valid_posting_date }

The user creates a metadata type called "original_posting_date"
with a label of "Original Posting Date" and a 'lookup' value
of "is_valid_posting_date".  When the metadata form is filled
in and submitted, the date value is validated by our validator.
Since the python 'parser' function accepts many kinds of input,
the user can enter (for example) '9/1/2014', '2014/10/2',
or even 'Feb 4, 2001'.  If the user enters something that
does not (as far as python is concerned) represent a valid date,
the system will raise a "ValidationError" and the form will
be re-displayed with an appropriate error message.  If, however,
the data is valid, the valid of the field (and, hence, stored
in the database) will be "normalized" to ISO format YYYY-MM-DD.
This allows consistent lookup and indexing regardless of the
users particular idiosyncracies.
2014-09-22 12:30:15 -04:00
Roberto Rosario
b761037d99 Move all settings files from <app>/conf/settings.py to <app>/settings.py 2014-09-11 05:02:40 -04:00
Roberto Rosario
77acb809b9 Update view references to include namespaces 2014-09-06 17:28:40 -04:00
Roberto Rosario
5caf616707 German translation files update 2014-09-05 14:40:15 -04:00
Roberto Rosario
d7aef36442 Add url namespacing to the checkouts, linking, metadata, sources and tags apps 2014-08-26 04:06:09 -04:00
Roberto Rosario
b42e9badf6 Move common templates to apps/main/templates/main/* 2014-08-26 02:44:49 -04:00
Roberto Rosario
01a0d69a5f Generate new source language files 2014-07-31 20:27:52 -04:00