Discussion:
[Erp5-dev] [Erp5-report] r21367 - /erp5/trunk/products/ERP5/PropertySheet/
Mikolaj Antoszkiewicz
2008-06-06 11:21:40 UTC
Permalink
Hello,
Why the messages for the constraints have been left out? The standard
error messages are big nad ugly :). Why not set here more user friendly
ones?
+ """
+ Constraintsts For Task
+ """
+
+ _constraints = (
+ { 'id' : 'title_existence',
+ 'description' : 'Title must be defined',
+ 'type' : 'StringAttributeMatch',
+ 'title' : '^[^ ]',
+ },
+ { 'id' : 'source',
+ 'description' : 'Source must be defined',
+ 'type' : 'CategoryMembershipArity',
+ 'min_arity' : '1',
+ 'max_arity' : '1',
+ 'portal_type' : ('Person', 'Organisation', 'Category'),
+ 'base_category' : ('source',)
+ },
In the RelationStringField for source and destination there's used a
method getPortalNodeTypeList which returns only 'Person'.
Should there be three portal types (as above) listed explicitely in
Portal Types attribute, or rather the method needs fixing?
+ { 'id' : 'destination',
+ 'description' : 'Destination must be defined',
+ 'type' : 'CategoryMembershipArity',
+ 'min_arity' : '1',
+ 'max_arity' : '1',
+ 'portal_type' : ('Person', 'Organisation', 'Category'),
+ 'base_category' : ('destination',)
+ },
+ { 'id' : 'start_date_existence',
+ 'description' : 'Property start_date must be defined',
+ 'type' : 'PropertyExistence',
+ 'start_date' : None,
+ },
+ { 'id' : 'stop_date_existence',
+ 'description' : 'Property stop date must be defined',
+ 'type' : 'PropertyExistence',
+ 'stop_date' : None,
+ },
+
+ { 'id' : 'lines',
+ 'description' : 'Lines must be defined',
+ 'type' : 'ContentExistence',
+ 'portal_type' : ('Task Line', 'Task Report Line' ),
+ },
+ )
+
Mikolaj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3229 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080606/0527289c/attachment.bin>
Rafael Monnerat
2008-06-06 12:25:21 UTC
Permalink
This was my work from long time ago, I committed it, but it's not setted
as default on tasks.

I already saw your files on this list and I planned to merge some parts
soon.

Thanks,

Rafael Monnerat
Post by Mikolaj Antoszkiewicz
Hello,
Why the messages for the constraints have been left out? The standard
error messages are big nad ugly :). Why not set here more user friendly
ones?
+ """
+ Constraintsts For Task
+ """
+ + _constraints = (
+ { 'id' : 'title_existence',
+ 'description' : 'Title must be defined',
+ 'type' : 'StringAttributeMatch',
+ 'title' : '^[^ ]',
+ },
+ { 'id' : 'source',
+ 'description' : 'Source must be defined',
+ 'type' : 'CategoryMembershipArity',
+ 'min_arity' : '1',
+ 'max_arity' : '1',
+ 'portal_type' : ('Person', 'Organisation', 'Category'),
+ 'base_category' : ('source',)
+ },
In the RelationStringField for source and destination there's used a
method getPortalNodeTypeList which returns only 'Person'.
Should there be three portal types (as above) listed explicitely in
Portal Types attribute, or rather the method needs fixing?
+ { 'id' : 'destination',
+ 'description' : 'Destination must be defined',
+ 'type' : 'CategoryMembershipArity',
+ 'min_arity' : '1',
+ 'max_arity' : '1',
+ 'portal_type' : ('Person', 'Organisation', 'Category'),
+ 'base_category' : ('destination',)
+ },
+ { 'id' : 'start_date_existence',
+ 'description' : 'Property start_date must be defined',
+ 'type' : 'PropertyExistence',
+ 'start_date' : None,
+ },
+ { 'id' : 'stop_date_existence',
+ 'description' : 'Property stop date must be defined',
+ 'type' : 'PropertyExistence',
+ 'stop_date' : None,
+ },
+
+ { 'id' : 'lines',
+ 'description' : 'Lines must be defined',
+ 'type' : 'ContentExistence',
+ 'portal_type' : ('Task Line', 'Task Report Line' ),
+ },
+ )
+
Mikolaj
------------------------------------------------------------------------
_______________________________________________
Erp5-dev mailing list
Erp5-dev at erp5.org
http://mail.nexedi.com/mailman/listinfo/erp5-dev
Loading...