<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: On a Simple IronPython Validation Framework</title>
	<link>http://www.dllhell.net/index.php/2008/04/08/on-a-simple-ironpython-validation-framework/</link>
	<description>John Zablocki's thoughts on code, technology and teaching...</description>
	<pubDate>Fri, 30 Jul 2010 08:01:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>

	<item>
		<title>By: Zahid Rasool</title>
		<link>http://www.dllhell.net/index.php/2008/04/08/on-a-simple-ironpython-validation-framework/#comment-440</link>
		<author>Zahid Rasool</author>
		<pubDate>Wed, 11 Jun 2008 11:51:25 +0000</pubDate>
		<guid>http://www.dllhell.net/index.php/2008/04/08/on-a-simple-ironpython-validation-framework/#comment-440</guid>
					<description>How can we add validation for datatime. There is no option, can we have source code for Python Engine.</description>
		<content:encoded><![CDATA[<p>How can we add validation for datatime. There is no option, can we have source code for Python Engine.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: John Zablocki</title>
		<link>http://www.dllhell.net/index.php/2008/04/08/on-a-simple-ironpython-validation-framework/#comment-443</link>
		<author>John Zablocki</author>
		<pubDate>Thu, 12 Jun 2008 03:18:23 +0000</pubDate>
		<guid>http://www.dllhell.net/index.php/2008/04/08/on-a-simple-ironpython-validation-framework/#comment-443</guid>
					<description>Hi Zahid,

The PythonEngine is part of IronPython.  You can download that at http://www.codeplex.com/IronPython/.  

I'm not sure if this is what you were looking for, but I added a sample to the validation project that adds a DateTime property to the User class.  The updated code is at http://code.google.com/p/codevoyeur-samples/.  

The new property, Birthday, is a DateTime with a new Validation attribute.  

&lt;code&gt;
[Validation("is_valid_birthdate")]
public DateTime Birthday { get; set; }
&lt;/code&gt;
The validation rule simply checks whether the property value for Birthday is a date prior to now.
&lt;code&gt;
&#60;rule name="is_valid_birthdate" message="Birthday must be a date prior to today"&#62;    
    result = property_value.CompareTo(DateTime.Now) == -1
  &#60;/rule&#62;
&lt;/code&gt;

-- John</description>
		<content:encoded><![CDATA[<p>Hi Zahid,</p>
<p>The PythonEngine is part of IronPython.  You can download that at <a href="http://www.codeplex.com/IronPython/." rel="nofollow">http://www.codeplex.com/IronPython/.</a>  </p>
<p>I&#8217;m not sure if this is what you were looking for, but I added a sample to the validation project that adds a DateTime property to the User class.  The updated code is at <a href="http://code.google.com/p/codevoyeur-samples/." rel="nofollow">http://code.google.com/p/codevoyeur-samples/.</a>  </p>
<p>The new property, Birthday, is a DateTime with a new Validation attribute.  </p>
<p><code><br />
[Validation("is_valid_birthdate")]<br />
public DateTime Birthday { get; set; }<br />
</code><br />
The validation rule simply checks whether the property value for Birthday is a date prior to now.<br />
<code><br />
&lt;rule name="is_valid_birthdate" message="Birthday must be a date prior to today"&gt;<br />
    result = property_value.CompareTo(DateTime.Now) == -1<br />
  &lt;/rule&gt;<br />
</code></p>
<p>&#8211; John</p>
]]></content:encoded>
				</item>
</channel>
</rss>
