You can subscribe to this list here.
2004 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(8) |
Nov
(9) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(13) |
May
(34) |
Jun
(7) |
Jul
(6) |
Aug
(1) |
Sep
(23) |
Oct
(37) |
Nov
(41) |
Dec
(39) |
2006 |
Jan
(19) |
Feb
(1) |
Mar
(5) |
Apr
(9) |
May
(3) |
Jun
(8) |
Jul
(6) |
Aug
(12) |
Sep
(15) |
Oct
(26) |
Nov
(7) |
Dec
(11) |
2007 |
Jan
(12) |
Feb
(6) |
Mar
(13) |
Apr
(14) |
May
(12) |
Jun
(8) |
Jul
(3) |
Aug
|
Sep
(4) |
Oct
(19) |
Nov
(9) |
Dec
|
2008 |
Jan
(14) |
Feb
(3) |
Mar
(11) |
Apr
(6) |
May
(18) |
Jun
(15) |
Jul
(1) |
Aug
(23) |
Sep
(18) |
Oct
(39) |
Nov
(11) |
Dec
(16) |
2009 |
Jan
(8) |
Feb
(9) |
Mar
(33) |
Apr
(16) |
May
(5) |
Jun
(3) |
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(6) |
Nov
(11) |
Dec
(2) |
2010 |
Jan
(2) |
Feb
(4) |
Mar
|
Apr
|
May
(2) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(36) |
Sep
(8) |
Oct
(1) |
Nov
|
Dec
(10) |
2012 |
Jan
(3) |
Feb
(5) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(10) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(4) |
2015 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
|
2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris L. <ch...@ka...> - 2013-11-13 03:22:37
|
Hi, I have released FormEncode 1.3.0a1 to PyPI. This is an alpha version to gather more feedback about the changes to support Python 3. If you are using a recent version of pip this will not install without an explicit version in the requirement specifier. The major outstanding item for a final 1.3.0 release is documentation. Thanks to all the people who posted bug reports, pull requests and code/documentation in other forms. -Chris -- Christopher Lambacher ch...@ka... |
From: Christoph Z. <ci...@on...> - 2013-02-01 12:05:48
|
I have worked a bit more on the use_2to3 based solution and now all tests (including the doctests) are running on Py 2.6, 2.7, 3.2 and 3.3. The semantics of the String and UnicodeString validators is now a bit different of course, and everything works under the assumption that the "other" side is already decoded to strings in Python 3, not bytes. -- Christoph |
From: Christoph Z. <ci...@on...> - 2013-01-31 21:23:07
|
Am 31.01.2013 05:11, schrieb Chris Lambacher: > After I put out the 1.2.5 release and created a branch for 1.2.x I > started playing around with doing a Python 3 port. I tried to do it > semi-automatically with python-modernize with the six and > --compat-unicode options. It didn't even close to work cleanly and I > was trying to work out how to get the meta class to work when I ran > out of time. I've since seen some code that works on 2 & 3 that does > the same thing I was trying to get to work so, I was on the right > track. I *might* have some time in Feb to pick up on this. But if > someone else wants to take a run at it that would be good. I've just checked in a different solution with the use_2to3 option of Distribute, which creates a Python 3 version at build time. Your solution using python-modernize to create a codebase that runs on both versions with the help of six could be a better idea, though. But the main difficulty we're facing is the semantics of the String and Unicode validators under Python 3. Should we provide Bytes and String validators under Python 3 instead? How can we create a documentation that covers both versions of the validators with the automatic tools? I'm wondering whether creating a separate formencode3 library for Python 3 could make more sense? -- Christoph |
From: Chris L. <ch...@ka...> - 2013-01-31 04:11:13
|
Hi Christoph, After I put out the 1.2.5 release and created a branch for 1.2.x I started playing around with doing a Python 3 port. I tried to do it semi-automatically with python-modernize with the six and --compat-unicode options. It didn't even close to work cleanly and I was trying to work out how to get the meta class to work when I ran out of time. I've since seen some code that works on 2 & 3 that does the same thing I was trying to get to work so, I was on the right track. I *might* have some time in Feb to pick up on this. But if someone else wants to take a run at it that would be good. I didn't run the tests with the Python 3 warnings first so that might be a good first step (i.e. convert "except Invalid, e" to "except Invalid as e"). -Chris On Wed, Jan 30, 2013 at 7:22 PM, Christoph Zwerschke <ci...@on...> wrote: > What is the current state of Python 3 support > (https://github.com/formencode/formencode/issues/2), > is anybody working on it? > > -- Christoph > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_jan > _______________________________________________ > FormEncode-discuss mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formencode-discuss > -- Christopher Lambacher ch...@ka... |
From: Christoph Z. <ci...@on...> - 2013-01-31 00:22:29
|
What is the current state of Python 3 support (https://github.com/formencode/formencode/issues/2), is anybody working on it? -- Christoph |
From: Chris L. <ch...@ka...> - 2012-12-15 19:24:25
|
Hi, I have just posted FormEncode 1.2.5 to pypi. This will be the last release that supports Python 2.5 and below. The next release will support Pythong 2.6, 2.7 and Python 3. If you are running on an old version of Python, ensure that you have appropriately pinned your versions. There was a new error message added to this release which requires translation. If you want to translate this message please let me know. -Chris -- Christopher Lambacher ch...@ka... |
From: Felix S. <fel...@os...> - 2012-09-14 19:02:04
|
Am 14.09.2012 18:00, schrieb Chris Lambacher: > RHEL6 looks like it supports 2.5 and 2.6 would you then need 2.5 support or > your app would work with the latest version available on the system OS? RHEL 6 provides only Python 2.6. MediaCore works on Python 2.4-2.7 (whatever the user chooses). The main difficulty is that it's software installed by random users on their various environments. And it turns out a number of hosts still only provide 2.4 (usually on RHEL/CentOS 5). > I'll do a maintenance branch for 1.2 before we start on 1.3 and we can > continue to do bugfix releases but maybe people using older versions Python > should start pinning their versions or FormEncode to < 1.3 so that you don't > get version that don't work for you on PyPI. Version pinning is no problem for MediaCore, that was done by the old maintainers anyway (we host all dependencies on the project server so also Pypi downtime does not affect users). A stable 1.2 branch with security fixes only would be actually great solution to us! > I want to have a mixed 2.x 3.x code base and not have to deal with 2to3 and > some of the things you need to do to make it work with older versions of > Python (like > <http://docs.pythonsprints.com/python3_porting/py-porting.html#handling-exceptions>) > are not pretty. Making 2.6 be the lowest supporte version make things much > simpler. I didn't have any troubles using 2to3 on a code base and thus supporting Python 2.3 - 3.2. The only real PITA is doctests which are (IMHO) not portable. Heck, I even had troubles for different versions of Python 2.x when the repr output for a class changed (Decimal in 2.4 vs. 2.5+). fs |
From: Chris L. <ch...@ka...> - 2012-09-14 16:00:46
|
On Tue, Sep 11, 2012 at 3:09 AM, Felix Schwarz <fel...@os... > wrote: > I'll stop supporting Python 2.4 for all libraries I maintain on March 2017 > when RHEL 5 goes EOL. > RHEL6 looks like it supports 2.5 and 2.6 would you then need 2.5 support or your app would work with the latest version available on the system OS? > That being said MediaCore uses FormEncode only in simple functionality and > we > don't need new FormEncode features so I guess we can stay with 1.2.5 for > quite > some time. > I'll do a maintenance branch for 1.2 before we start on 1.3 and we can continue to do bugfix releases but maybe people using older versions Python should start pinning their versions or FormEncode to < 1.3 so that you don't get version that don't work for you on PyPI. I want to have a mixed 2.x 3.x code base and not have to deal with 2to3 and some of the things you need to do to make it work with older versions of Python (like < http://docs.pythonsprints.com/python3_porting/py-porting.html#handling-exceptions>) are not pretty. Making 2.6 be the lowest supporte version make things much simpler. -Chris -- Christopher Lambacher ch...@ka... |
From: Chris L. <ch...@ka...> - 2012-09-14 12:26:42
|
Hi, There are some bugs in the issue tracker that seem to directly tied to how Pylons uses FormEncode if you are still using Pylons please comment on them. The specific bugs are: https://github.com/formencode/formencode/issues/4 https://github.com/formencode/formencode/issues/9 https://github.com/formencode/formencode/issues/10 #4 specifically looks like htmlfill is being used incorrectly. htmlfill is designed to be run over the html of the form and not the whole response, which is why I think this is happening. Other problems that crop when you have multiple forms on a page. -Chris -- Christopher Lambacher ch...@ka... |
From: Felix S. <fel...@os...> - 2012-09-11 07:26:19
|
Am 10.09.2012 14:58, schrieb Chris Lambacher: > The plan is that 1.3.0 will drop support for at least python 2.3 and probably > 2.4 and 2.5. Anyone using 2.4 or 2.5 should speak up about their need for > continued support. We use FormEncode in MediaCore (www.mediacorecommunity.org) and there are still many customers using 2.4 (roughly 20%). I plan on supporting 2.4 in MediaCore for the foreseeable future (2-3 years) though some smaller features might be 2.6+. I'll stop supporting Python 2.4 for all libraries I maintain on March 2017 when RHEL 5 goes EOL. That being said MediaCore uses FormEncode only in simple functionality and we don't need new FormEncode features so I guess we can stay with 1.2.5 for quite some time. fs |
From: Ian W. <ven...@gm...> - 2012-09-11 06:52:46
|
I have something coming up this weekend, but maybe the next weekend? Did you want to set a date for some sort of mini-sprint? On Mon, Sep 10, 2012 at 5:58 AM, Chris Lambacher <ch...@ka...>wrote: > Hi Everyone, > > I'd like to get a 1.2.5 release out the door so we can properly start on > Python 3.x support and a 1.3.0 release. I've copied the remaining issues > from sourceforge to github and added the blockers for a 1.2.5 release to > the 1.2.5 milestone. Any help people can give with triaging these issues > would be greatly appreciated. Many of the outstanding bugs are for htmlfill > which I don't use so if you are an htmlfill user and can comment or provide > a concrete test case that would be very helpful. > > The plan is that 1.3.0 will drop support for at least python 2.3 and > probably 2.4 and 2.5. Anyone using 2.4 or 2.5 should speak up about their > need for continued support. > > -Chris > > -- > Christopher Lambacher > ch...@ka... > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > FormEncode-discuss mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formencode-discuss > > |
From: Christoph Z. <ci...@on...> - 2012-09-10 13:50:56
|
Am 10.09.2012 14:49, schrieb Chris Lambacher: > I've already configured the Read The Docs hook in github. I've also > just given you push access to the repo. My user on Read The Docs is > lambacck. Ok, already pushed my changes. I tried to add you on ReadTheDocs, but was amazed to find that it's currently impossible to add other admins. -- Christoph |
From: Chris L. <ch...@ka...> - 2012-09-10 12:58:24
|
Hi Everyone, I'd like to get a 1.2.5 release out the door so we can properly start on Python 3.x support and a 1.3.0 release. I've copied the remaining issues from sourceforge to github and added the blockers for a 1.2.5 release to the 1.2.5 milestone. Any help people can give with triaging these issues would be greatly appreciated. Many of the outstanding bugs are for htmlfill which I don't use so if you are an htmlfill user and can comment or provide a concrete test case that would be very helpful. The plan is that 1.3.0 will drop support for at least python 2.3 and probably 2.4 and 2.5. Anyone using 2.4 or 2.5 should speak up about their need for continued support. -Chris -- Christopher Lambacher ch...@ka... |
From: Chris L. <ch...@ka...> - 2012-09-10 12:49:20
|
This got direct replied instead of going to the list :( ---------- Forwarded message ---------- From: Chris Lambacher <ch...@ka...> Date: Mon, Sep 10, 2012 at 8:48 AM Subject: Re: [FE-discuss] Formencode Read The Docs Configuration Update To: Christoph Zwerschke <ci...@on...> 2012/9/10 Christoph Zwerschke <ci...@on...> > ich hab das in ReadTheDocs geändert, aber ich habe keinen Admin-Zugang auf > das Repo in GitHub, um den Service Hook for ReadTheDocs hinzuzufügen. > Kannst du mich (Cito) auf GitHub auch wieder als Collaborator zu FormEncode > hinzufügen? Ich habe noch ein paar weitere Stellen in den Docs gefixt. Ich > kann dich mit dem Public API auch als User auf ReadTheDocs hinzufügen, aber > ich brauche deinen Accountnamen auf ReadTheDocs dafür. > Translation: > I've changed in the ReadTheDocs, but I have no admin access to the repo in GitHub to add the > service hook for ReadTheDocs. Can you add me (Cito) on GitHub again as Collaborator to > FormEncode? I've fixed a few more points in the docs. I can add you to the Public API as > User ReadTheDocs, but I need your account name for ReadTheDocs. Hi Christoph, I've already configured the Read The Docs hook in github. I've also just given you push access to the repo. My user on Read The Docs is lambacck. Thanks for the prompt reply, Chris -- Christopher Lambacher ch...@ka... -- Christopher Lambacher ch...@ka... |
From: Chris L. <ch...@ka...> - 2012-09-10 02:18:37
|
Hi, I don't have the admin account for the FormEncode read the docs site. Can someone update it to source from github and accept the push notifications? -Chris -- Christopher Lambacher ch...@ka... |
From: Chris L. <ch...@ka...> - 2012-07-27 21:20:54
|
On Fri, Jul 27, 2012 at 5:09 PM, Iain Duncan <iai...@gm...>wrote: > > On Fri, Jul 27, 2012 at 1:50 PM, Chris Lambacher <ch...@ka...>wrote: > >> On Fri, Jul 27, 2012 at 4:45 PM, Iain Duncan <iai...@gm...>wrote: >> >>> The above was exactly what I needed. Is there a reason this is not >>> included in the narrative docs? It would be really helpful to have it >>> mentioned on this page somewhere, >> >> >> The docs suck and need major work. There have been some efforts in the >> past and they are better than they were. >> >> Most things have comments in the code that document them, but these have >> not been surface to user consumable docs: >> >> https://github.com/formencode/formencode/blob/master/formencode/schema.py#L56 >> >> >> There are a bunch of properties of Schema that change the operation that >> need to be documented somewhere. I generally need to open the code to know >> the names of them. >> >> > Hmm, that's a pity. Is it possible for us to volunteer time on them? Is > editing them open? I use formencode enough that I figure we can assign at > least an hour or two to fixing up some docs. > Yes please. If you want you can use github's web editing feature to edit the docs right there (behind the scenes it does a fork and a pull request). I try to accept or reject pull requests pretty quickly: https://github.com/formencode/formencode I don't have the keys to the read the docs admin so someone needs to update it to accept the new repo location for the push hooks. thanks > Iain > Your welcome, and thank you. -- Christopher Lambacher ch...@ka... |
From: Iain D. <iai...@gm...> - 2012-07-27 21:09:58
|
On Fri, Jul 27, 2012 at 1:50 PM, Chris Lambacher <ch...@ka...>wrote: > On Fri, Jul 27, 2012 at 4:45 PM, Iain Duncan <iai...@gm...>wrote: > >> The above was exactly what I needed. Is there a reason this is not >> included in the narrative docs? It would be really helpful to have it >> mentioned on this page somewhere, > > > The docs suck and need major work. There have been some efforts in the > past and they are better than they were. > > Most things have comments in the code that document them, but these have > not been surface to user consumable docs: > > https://github.com/formencode/formencode/blob/master/formencode/schema.py#L56 > > > There are a bunch of properties of Schema that change the operation that > need to be documented somewhere. I generally need to open the code to know > the names of them. > > Hmm, that's a pity. Is it possible for us to volunteer time on them? Is editing them open? I use formencode enough that I figure we can assign at least an hour or two to fixing up some docs. thanks Iain > -Chris > > -- > Christopher Lambacher > ch...@ka... > |
From: Chris L. <ch...@ka...> - 2012-07-27 20:51:05
|
On Fri, Jul 27, 2012 at 4:45 PM, Iain Duncan <iai...@gm...>wrote: > The above was exactly what I needed. Is there a reason this is not > included in the narrative docs? It would be really helpful to have it > mentioned on this page somewhere, The docs suck and need major work. There have been some efforts in the past and they are better than they were. Most things have comments in the code that document them, but these have not been surface to user consumable docs: https://github.com/formencode/formencode/blob/master/formencode/schema.py#L56 There are a bunch of properties of Schema that change the operation that need to be documented somewhere. I generally need to open the code to know the names of them. -Chris -- Christopher Lambacher ch...@ka... |
From: Iain D. <iai...@gm...> - 2012-07-27 20:45:42
|
> > > class PersonValidationSchema(ValidationSchema): > """validation schema for resource Person""" > # will totally ignore a missing value (unless if_missing provided) > ignore_key_missing = True > name_first = v.UnicodeString(not_empty=True) > name_last = v.UnicodeString(not_empty=True) > birthdate = IsoDate() > > The above was exactly what I needed. Is there a reason this is not included in the narrative docs? It would be really helpful to have it mentioned on this page somewhere, http://www.formencode.org/en/latest/Validator.html if it's in the docs, I had a hard time finding anything. Thanks so much! Iain |
From: Chris L. <ch...@ka...> - 2012-07-27 20:32:40
|
On Fri, Jul 27, 2012 at 4:17 PM, Iain Duncan <iai...@gm...> > > This should pass: > { 'name_last':'Duncan', 'birthdate':'1911-01-01'} > > This should fail: > {'name_last':'Duncan', 'name_first': '', 'birthdate': '1911-01-01' } > > thanks! > I don't think I am totally clear on the problem yet, but I am guessing that you don't like the Value Missing error in the first case and the second case the Empty value error is correct. If that is correct then what you want I think is: class PersonValidationSchema(ValidationSchema): """validation schema for resource Person""" # will take if_missing value unvalidated name_first = v.UnicodeString(not_empty=True, if_missing=None) name_last = v.UnicodeString(not_empty=True, if_missing=None) birthdate = IsoDate() or class PersonValidationSchema(ValidationSchema): """validation schema for resource Person""" # will totally ignore a missing value (unless if_missing provided) ignore_key_missing = True name_first = v.UnicodeString(not_empty=True) name_last = v.UnicodeString(not_empty=True) birthdate = IsoDate() or class PersonValidationSchema(ValidationSchema): """validation schema for resource Person""" # will run the validator with the value given (i.e. None) if_key_missing = None name_first = v.UnicodeString(not_empty=True) name_last = v.UnicodeString(not_empty=True) birthdate = IsoDate() -Chris -- Christopher Lambacher ch...@ka... |
From: Iain D. <iai...@gm...> - 2012-07-27 20:17:14
|
On Fri, Jul 27, 2012 at 1:15 PM, Iain Duncan <iai...@gm...>wrote: > Hi Chris, I'm not sure if what you're suggesting is what I want. Here's a > clarification, maybe you can tell me. > > The schema for my tests looks like: > > class PersonValidationSchema(ValidationSchema): > """validation schema for resource Person""" > name_first = v.UnicodeString(not_empty=True) > name_last = v.UnicodeString(not_empty=True) > birthdate = IsoDate() > > The names can't be empty, which is correct, because I want errors if we're > sent post values with empty strings for them. But what I need to be able to > do for Dojo is receive and *pass* a post dict that is missing a name_last > key, and get a validated dict also missing a name_last key. When that > happens, the write to the db will update only the fields that have keys in > my post vals, and ignore the others ( not setting them to none or any > default value). > > This should pass: { 'name_last':'Duncan', 'birthdate':'1911-01-01'} This should fail: {'name_last':'Duncan', 'name_first': '', 'birthdate': '1911-01-01' } thanks! |
From: Iain D. <iai...@gm...> - 2012-07-27 20:15:06
|
Hi Chris, I'm not sure if what you're suggesting is what I want. Here's a clarification, maybe you can tell me. The schema for my tests looks like: class PersonValidationSchema(ValidationSchema): """validation schema for resource Person""" name_first = v.UnicodeString(not_empty=True) name_last = v.UnicodeString(not_empty=True) birthdate = IsoDate() The names can't be empty, which is correct, because I want errors if we're sent post values with empty strings for them. But what I need to be able to do for Dojo is receive and *pass* a post dict that is missing a name_last key, and get a validated dict also missing a name_last key. When that happens, the write to the db will update only the fields that have keys in my post vals, and ignore the others ( not setting them to none or any default value). Does that makes sense? Is that something I can do with what you are suggesting? thanks! Iain On Fri, Jul 27, 2012 at 1:04 PM, Chris Lambacher <ch...@ka...>wrote: > Hi Iain, > > If what you want is to do is conditionally require some values then what > you are looking for is RequireIfMissing/RequireIfPresent which you put in > the chained_validators for the Schema: > > http://www.formencode.org/en/latest/modules/validators.html#formencode.validators.RequireIfMissing > > > Note that it won't block other validation errors, so if you have an Int > validator and get a string, that validator will still give you an error > even if it will ultimately be ignored. > > If that is a concern you can do a pre_validator that modifies / replaces > the value dict such that it includes only the values that should be kept. > > -Chris > > On Fri, Jul 27, 2012 at 2:39 PM, Iain Duncan <iai...@gm...>wrote: > >> Hi, I'm using form encode for validation, and am building a ReST back end >> for use with Dojo data stores. the Dojo system wants to be able to use PUT >> requests with partial lists of params, and I'm trying to figure out best to >> do that. So if I have a schema, and some keys are missing, I want it to >> 'pass', with the values dictionary as is, rather than having the values >> dict have values for the missing keys that come from using if_missing='foo'. >> >> Is there way to do that without resorting to hackery like inspecting the >> errors and discarding all the ones that are missing value errors? >> >> thanks >> Iain >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> FormEncode-discuss mailing list >> For...@li... >> https://lists.sourceforge.net/lists/listinfo/formencode-discuss >> >> > > > -- > Christopher Lambacher > ch...@ka... > |
From: Chris L. <ch...@ka...> - 2012-07-27 20:04:26
|
Hi Iain, If what you want is to do is conditionally require some values then what you are looking for is RequireIfMissing/RequireIfPresent which you put in the chained_validators for the Schema: http://www.formencode.org/en/latest/modules/validators.html#formencode.validators.RequireIfMissing Note that it won't block other validation errors, so if you have an Int validator and get a string, that validator will still give you an error even if it will ultimately be ignored. If that is a concern you can do a pre_validator that modifies / replaces the value dict such that it includes only the values that should be kept. -Chris On Fri, Jul 27, 2012 at 2:39 PM, Iain Duncan <iai...@gm...>wrote: > Hi, I'm using form encode for validation, and am building a ReST back end > for use with Dojo data stores. the Dojo system wants to be able to use PUT > requests with partial lists of params, and I'm trying to figure out best to > do that. So if I have a schema, and some keys are missing, I want it to > 'pass', with the values dictionary as is, rather than having the values > dict have values for the missing keys that come from using if_missing='foo'. > > Is there way to do that without resorting to hackery like inspecting the > errors and discarding all the ones that are missing value errors? > > thanks > Iain > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > FormEncode-discuss mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formencode-discuss > > -- Christopher Lambacher ch...@ka... |
From: Iain D. <iai...@gm...> - 2012-07-27 18:39:47
|
Hi, I'm using form encode for validation, and am building a ReST back end for use with Dojo data stores. the Dojo system wants to be able to use PUT requests with partial lists of params, and I'm trying to figure out best to do that. So if I have a schema, and some keys are missing, I want it to 'pass', with the values dictionary as is, rather than having the values dict have values for the missing keys that come from using if_missing='foo'. Is there way to do that without resorting to hackery like inspecting the errors and discarding all the ones that are missing value errors? thanks Iain |
From: Chris L. <ch...@ka...> - 2012-07-21 18:44:03
|
Generally want SimpleFormValidators to be either pre_validators or chained_validators see the docs here: http://www.formencode.org/en/latest/Validator.html#compound-validators So I would normally do: class ProductConfigurationSchema(Schema): filter_extra_fields = True allow_extra_fields = True bool_field = validators.Bool() text_field = UnicodeString(max=100) chained_validators = [ SimpleFormValidator(validate_text) ] In this case, the main validator gets the bare minimum validation (I must be a unicode string and may have a max length of 100). Following on that you do form level validation in the chained_validators so I would expect validate_text do do something like make text_field required if bool_field is true (Note that there is a good model for building that built in a RequireIfMissing/RequireIfPresent http://www.formencode.org/en/latest/modules/validators.html#formencode.validators.RequireIfMissing ). One thing you can do with pre_validtors is throw data away if a value is set. So if your Bool() field was for deletion, you could remove the other data from the form so that incorrect data does not cause a validation error. -Chris On Sat, Jul 21, 2012 at 2:09 PM, Michael Jenny <pri...@gm...>wrote: > Hi there, > > i have a schema validator and want to use another compound validator > (SimpleFormValidator) from within the schema. > > E.g. I do something along the lines: > > > def validate_text(value_dict, state, validator): > > # validation of text_field goes here. check value_dict for > bool_field's value to determine what to do next. > > > class ProductConfigurationSchema(Schema): > filter_extra_fields = True > allow_extra_fields = True > > bool_field = validators.Bool() > text_field = SimpleFormValidator(validate_text) > > > This does not work as the schema does not expect that its fields are > compound validators. It doesn't pass the value_dict to the > SimpleFormValidator but rather a single value. This results in the > following errror in SimpleFormValidators to_python method: > > value_dict = value_dict.copy() > AttributeError: 'unicode' object has no attribute 'copy' > > > I followed that route because I want to achieve the following: > > The visibility of the text_field depends on the bool_field. Therefore I'd > thought I write a custom method that checks the state of the bool when > validating the text_field. If it is set, I would perform the actual > validation. If the bool is not set, the text_field is irrelevant and > validating would essentially be a no-op. > > > Any tip how to tackle this? > > > Cheers, prinz. > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > FormEncode-discuss mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formencode-discuss > > -- Christopher Lambacher ch...@ka... |