Login  Register

Magritte Meta Data at work - Tutorial a clarity reqd

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Magritte Meta Data at work - Tutorial a clarity reqd

Sanjay Minni
189 posts
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
cheers,
Sanjay
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Magritte Meta Data at work - Tutorial a clarity reqd

Stéphane Ducasse
17193 posts
probably a mistake :( send a PR when you find the solution. 

On 26 Jan 2021, at 10:31, Sanjay Minni <[hidden email]> 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
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

Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Magritte Meta Data at work - Tutorial a clarity reqd

Sanjay Minni
189 posts
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:
==================================
    PharoDescContErr1.jpg


B: whole screen formatting's gone haywire
=================================
    PharoDescContErr2.jpg



On Wed, 27 Jan 2021 at 00:00, Stéphane Ducasse <[hidden email]> wrote:
probably a mistake :( send a PR when you find the solution. 

On 26 Jan 2021, at 10:31, Sanjay Minni <[hidden email]> 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
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
cheers,
Sanjay
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Magritte Meta Data at work - Tutorial a clarity reqd

Sanjay Minni
189 posts
In reply to this post by Stéphane Ducasse
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 &lt;

> sm@

> &gt; 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
cheers,
Sanjay