Magritte Meta Data at work - Tutorial a clarity reqd
From pg 16 of "meta data at work with Magritte - Tutorial", Stef
how are these to be entered since both method codes are in the same object and methodName MAAddress >> descriptionEndDate ^ MADateDescription new accessor: #endDate; label: 'End Date'; addCondition: [ :value | value > Date today ]; beRequired; yourself MAAddress >> descriptionEndDate ^ super descriptionContainer addCondition: [ :object | (object readUsing: self descriptionEndDate) > (object readUsing: self descriptionStartDate)] labelled: 'End date must be after start date'; yourself ----- cheers, Sanjay -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
probably a mistake :( send a PR when you find the solution.
On 26 Jan 2021, at 10:31, Sanjay Minni <sm@planage.com> wrote:
From pg 16 of "meta data at work with Magritte - Tutorial", Stef
how are these to be entered since both method codes are in the same object and methodName
MAAddress >> descriptionEndDate
^ MADateDescription new accessor: #endDate; label: 'End Date'; addCondition: [ :value | value > Date today ]; beRequired; yourself
MAAddress >> descriptionEndDate
^ super descriptionContainer addCondition: [ :object | (object readUsing: self descriptionEndDate) > (object readUsing: self descriptionStartDate)] labelled: 'End date must be after start date'; yourself
----- cheers, Sanjay -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
-------------------------------------------- Stéphane Ducasse http://stephane.ducasse.free.fr / http://www.pharo.org 03 59 35 87 52 Assistant: Aurore Dalle FAX 03 59 57 78 50 TEL 03 59 35 86 16 S. Ducasse - Inria 40, avenue Halley, Parc Scientifique de la Haute Borne, Bât.A, Park Plaza Villeneuve d'Ascq 59650 France
Hi Stef, i tried by changing the method name to >> descriptionContainer which seemed obvious and then I got the following errors (added a field Graduation Date and a check at container lever for Graduation Date > Birthday) Request for any hints to the right solution. A: Walkback deprecated method being used: ================================== [image: PharoDescContErr1.jpg] B: whole screen formatting's gone haywire ================================= [image: PharoDescContErr2.jpg] On Wed, 27 Jan 2021 at 00:00, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
probably a mistake :( send a PR when you find the solution.
On 26 Jan 2021, at 10:31, Sanjay Minni <sm@planage.com> wrote:
From pg 16 of "meta data at work with Magritte - Tutorial", Stef
how are these to be entered since both method codes are in the same object and methodName
MAAddress >> descriptionEndDate
^ MADateDescription new accessor: #endDate; label: 'End Date'; addCondition: [ :value | value > Date today ]; beRequired; yourself
MAAddress >> descriptionEndDate
^ super descriptionContainer addCondition: [ :object | (object readUsing: self descriptionEndDate) > (object readUsing: self descriptionStartDate)] labelled: 'End date must be after start date'; yourself
----- cheers, Sanjay -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
-------------------------------------------- Stéphane Ducasse http://stephane.ducasse.free.fr / http://www.pharo.org 03 59 35 87 52 Assistant: Aurore Dalle FAX 03 59 57 78 50 TEL 03 59 35 86 16 S. Ducasse - Inria 40, avenue Halley, Parc Scientifique de la Haute Borne, Bât.A, Park Plaza Villeneuve d'Ascq 59650 France
-- --- Sanjay Minni +91-9900-902902
OK, got this to work as follows as of now Changed the second part of the code - i.e. to push the (validation) rules to the container as follows MAAddress >> descriptionContainer "// (i.e. not descriptionEndDate) as in the document" <magritteContainer> "// (i.e. not <magritteDescription> as in the document" ^ super descriptionContainer addCondition: [ :object | (object readUsing: self descriptionEndDate) > (object readUsing: self descriptionStartDate)] labelled: 'End date must be after start date'; yourself @Stef: If you want I can send a PR but I really haven't done it before and I dont have a GH client on my machine if thats reqd - i only interact thru iceberg - if thats relevant Stéphane Ducasse wrote
probably a mistake :( send a PR when you find the solution.
On 26 Jan 2021, at 10:31, Sanjay Minni <
sm@
> wrote:
From pg 16 of "meta data at work with Magritte - Tutorial", Stef
how are these to be entered since both method codes are in the same object and methodName
MAAddress >> descriptionEndDate
^ MADateDescription new accessor: #endDate; label: 'End Date'; addCondition: [ :value | value > Date today ]; beRequired; yourself
MAAddress >> descriptionEndDate
^ super descriptionContainer addCondition: [ :object | (object readUsing: self descriptionEndDate) > (object readUsing: self descriptionStartDate)] labelled: 'End date must be after start date'; yourself
----- cheers, Sanjay -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
-------------------------------------------- Stéphane Ducasse http://stephane.ducasse.free.fr / http://www.pharo.org 03 59 35 87 52 Assistant: Aurore Dalle FAX 03 59 57 78 50 TEL 03 59 35 86 16 S. Ducasse - Inria 40, avenue Halley, Parc Scientifique de la Haute Borne, Bât.A, Park Plaza Villeneuve d'Ascq 59650 France
----- cheers, Sanjay -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
participants (2)
-
Sanjay Minni -
Stéphane Ducasse