Re: UNS: Re: cleaner ToscaWidgets

2007-11-10 Thread Alberto Valverde

Matt Feifarek wrote:
 On Oct 24, 2007 5:06 PM, Alberto Valverde [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 
 Yep, was planning to do that when I cover tweaking the layout. Finally
 didn't have time to start part 2 today but will tomorrow...
 
 
 Hey Alberto -- did a part 2 ever fall out of your brain?

No, not yet. I've wish I could spare an afternoon sometime soon to do it
but I doubt it because I'm pretty busy at the moment. Sorry.

 We're eager to learn more about TW, and are having some troubles getting
 beyond the simple examples to our own custom fields and templates.

Your best bet at the moment is to search the archives of
toscawidgets-dicuss google group and/or study the templates of twForms'
fields and forms.

Alberto

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-11-08 Thread Matt Feifarek
On Oct 24, 2007 5:06 PM, Alberto Valverde [EMAIL PROTECTED] wrote:

 Yep, was planning to do that when I cover tweaking the layout. Finally
 didn't have time to start part 2 today but will tomorrow...


Hey Alberto -- did a part 2 ever fall out of your brain?

We're eager to learn more about TW, and are having some troubles getting
beyond the simple examples to our own custom fields and templates.

Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-24 Thread Max Ischenko
On 10/24/07, Ian Bicking [EMAIL PROTECTED] wrote:


 Max Ischenko wrote:
  One remark I noticed:
 
  We're importing the validators from the twForms' validators module.
  This module includes all validators from FormEncode but overrides
  UnicodeString so it doesn't encode strings when converting from python.
  This is needed because Genshi and Mako need all strings to be unicode
  internally (or at least be ascii encodable). 

 I think I might have just changed this in the trunk (which I'm planning
 to release shortly), so maybe it's a moot issue.


You mean you've changed it so the twForms' workaround needed again?




-- 
Max Ischenko
http://www.developers.org.ua/ -- Ukrainian software developers community
http://maxischenko.in.ua/ -- my blog (Russian)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-24 Thread Ian Bicking

Max Ischenko wrote:
 
 
 On 10/24/07, *Ian Bicking* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 
 Max Ischenko wrote:
   One remark I noticed:
  
   We're importing the validators from the twForms' validators
 module.
   This module includes all validators from FormEncode but overrides
   UnicodeString so it doesn't encode strings when converting from
 python.
   This is needed because Genshi and Mako need all strings to be unicode
   internally (or at least be ascii encodable). 
 
 I think I might have just changed this in the trunk (which I'm planning
 to release shortly), so maybe it's a moot issue.
 
 
 You mean you've changed it so the twForms' workaround needed again?

Now I'm not sure.  I changed it recently.  I don't know if that made it 
easier or harder, or if the workaround is needed again or not.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-24 Thread Alberto Valverde

John_Nowlan wrote:
 Thanks for this.
 I fall into the target audience (hand coder?, hmm.. sounds
 incriminating..)
 Appreciate the not diving in, but giving context first.
 
 Feedback, fwiw, after just reading, haven't had a chance to try yet
 (minor niggles or typos).
 
 - in a tutorial wouldn't the long form of commands be more explanatory?
 i.e. instead of 
 paster create -t Pylons TWTutorial 
 use 
 paster create --template=TEMPLATE Pylons TWTutorial
 
 - 'the kind of form CSS fan-boys usually love'
 - remove this. I'am all for humor, but this just seems a little jarring.
 
 - 'I hope the above hints one' - missing 'at' -  'I hope the above
 hints at one'...
 -  could you add a bit relating the html to the code here? Not being an
 expert, I'm curious to know if things such as 'class=even' come from
 the ListForm class and/or whether this is fixed html output and/or
 expecting a related css. At the end of the tutorial you mention in the
 coming next: 'How to tweak the form's template to precisely control its
 layout.'  So maybe just say that here, i.e. add a paragraph above 'Using
 the form in your application' that says: The layout of the form can be
 customized. 'How to tweak..' will be the subject of a following
 tutorial. 
 
 - 'This is due a limitation' - missing 'to' - 'This is due to a
 limitation'
 - I condider - I consider
 
 Other than that, this is a great help.
 Thanks again!

Thanks for the feedback! I've removed the typos, grammar errors (thanks
for that!) and my ill sense of humor ;).

I'll update the blog post soon, along with part 2 which will be an
extended fancy widgets part since it has been pointed out to me that
it doesn't belong in an introductory part 1.

However, will soon stop doing it since I'll be posting updates from now
on at Pylons wiki.

Sending a link to its new home as soon as an admin makes the
toscawidgets space public...

Alberto

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-24 Thread Mike Orr

On 10/24/07, John_Nowlan [EMAIL PROTECTED] wrote:
 -  could you add a bit relating the html to the code here? Not being an
 expert, I'm curious to know if things such as 'class=even' come from
 the ListForm class and/or whether this is fixed html output and/or
 expecting a related css. At the end of the tutorial you mention in the
 coming next: 'How to tweak the form's template to precisely control its
 layout.'  So maybe just say that here, i.e. add a paragraph above 'Using
 the form in your application' that says: The layout of the form can be
 customized. 'How to tweak..' will be the subject of a following
 tutorial.

That's an important point that those of us familiar with CSS
customizing can easily overlook.  Taking a *very* quick look at the
article, you might do something like this.  (This itself may look ugly
but it illustrates the point.)

 main.css 
/* Default settings for page */
body {
color: black;
background-color: white;
font-family: sans-serif;
font-size: 12px;
}

/* All forms of class 'postform' should be indented and have a colored border */
form.postform {
margin-left: 100px;
border-style: solid;
border-width: 2px;
border-color: #C5E3BF;   /* mint ice cream */
}

/* Every other row should have a light colored background */
/* This affects all li class=even elements, whether in a
'postform' or not. */
li.even {
background-color: #F0F8FF;   /* Alice blue */
}

/* All labels inside a 'postform' should be big and bold. */
form.postform label {
font-size: 18px;
font-weight: bold;
}

/* I don't see offhand where error messges go in this form, but this is
sorta what FormEncode would use.  This style affects any tag with
class=error.  Typically it would be a span, div, or td.  */
.error {
color: red;
font-weight: bold;
font-style: italic;
}


The CSS reference I use is:  http://www.richinstyle.com/guides/css2.html

The CSS Zen Garden will blow you away how much you can change a page
with styles:   http://www.csszengarden.com/
Click on any of the design titles in the right column.

Alberto, can we get a short stylesheet example in the tutorial?

-- 
Mike Orr [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



RE: UNS: Re: cleaner ToscaWidgets and descending into pylons version of dll hell

2007-10-24 Thread John_Nowlan

Now trying to do the tutorial:

(note: I had to update to python25 from 24 on windows because in trying
to do the tutorial I was getting an error about a missing python25.dll
after updating dependent packages (PasteDeploy-1.3.1, Beaker-0.8,
Webhelpers-0.3.2, Routes-1.7). Updating to 25 without changing path
fixed that problem.)

paster create -t Pylons TWTutorial - should be -paster create -t
pylons TWTutorial
- lowercase pylons not Pylons
- otherwise you get 'LookupError: Template by name 'Pylons' not found'

- make the first few code changes, get to the first paster serve..:

C:\Inetpub\pylonshome\TWTutorialpaster serve --reload development.ini
Starting subprocess with file monitor
Traceback (most recent call last):
  File C:\Python24\scripts\paster-script.py, line 7, in ?
sys.exit(
  File
c:\python24\lib\site-packages\PasteScript-1.3.6-py2.4.egg\paste\script\
command.py, line 78, in run
invoke(command, command_name, options, args[1:])
  File
c:\python24\lib\site-packages\PasteScript-1.3.6-py2.4.egg\paste\script\
command.py, line 117, in invoke
exit_code = runner.run(args)
  File
c:\python24\lib\site-packages\PasteScript-1.3.6-py2.4.egg\paste\script\
command.py, line 212, in run
result = self.command()
  File
c:\python24\lib\site-packages\PasteScript-1.3.6-py2.4.egg\paste\script\
serve.py, line 227, in command
relative_to=base, global_conf=vars)
  File
c:\python24\lib\site-packages\PasteScript-1.3.6-py2.4.egg\paste\script\
serve.py, line 248, in loadapp
return loadapp(
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 193, in loadapp
return loadobj(APP, uri, name=name, **kw)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 213, in loadobj
global_conf=global_conf)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 237, in loadcontext
global_conf=global_conf)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 267, in _loadconfig
return loader.get_context(object_type, name, global_conf)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 393, in get_context
section)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 414, in _context_from_use
context = self.get_context(
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 345, in get_context
global_conf=global_conf)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 237, in loadcontext
global_conf=global_conf)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 274, in _loadegg
return loader.get_context(object_type, name, global_conf)
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 541, in get_context
entry_point, protocol, ep_name = self.find_egg_entry_point(
  File
c:\python24\lib\site-packages\PasteDeploy-1.3.1-py2.4.egg\paste\deploy\
loadwsgi.py, line 568, in find_egg_entry_point
possible.append((entry.load(), protocol, entry.name))
  File
C:\Python24\lib\site-packages\setuptools-0.6c5-py2.4.egg\pkg_resources.
py, line 1830, in load
entry = __import__(self.module_name, globals(),globals(),
['__name__'])
  File
C:\Inetpub\pylonshome\TWTutorial\twtutorial\config\middleware.py, line
8, in ?
from pylons.error import error_template
  File
c:\python24\lib\site-packages\Pylons-0.9.6.1-py2.4.egg\pylons\error.py
, line 14, in ?
from paste.evalexception.middleware import *
  File
c:\python24\lib\site-packages\Paste-1.5.1-py2.4.egg\paste\evalexception
\__init__.py, line 6, in ?
from paste.evalexception.middleware import EvalException
  File
c:\python24\lib\site-packages\Paste-1.5.1-py2.4.egg\paste\evalexception
\middleware.py, line 36, in ?
from paste.exceptions import errormiddleware, formatter, collector
  File
c:\python24\lib\site-packages\Paste-1.5.1-py2.4.egg\paste\exceptions\er
rormiddleware.py, line 14, in ?
from paste.exceptions import formatter, collector, reporter
  File
c:\python24\lib\site-packages\Paste-1.5.1-py2.4.egg\paste\exceptions\re
porter.py, line 8, in ?
from socket import sslerror
ImportError: cannot import name sslerror

stuck :(


So I try on a development unix box. (Fits in with the split
personality...)
Have to update setuptools...
and ...

$ easy_install twForms
Searching for twForms
Reading http://www.pylonshq.com/download/
Reading http://pypi.python.org/simple/twForms/
Reading http://toscawidgets.org
Reading http://toscawidgets.org/download
Best match: twForms 0.1a2dev-r3508
Downloading
http://toscawidgets.org/download/twForms-0.1a2dev-r3508.tar.gz
Processing twForms-0.1a2dev-r3508.tar.gz
Running twForms-0.1a2dev-r3508/setup.py -q bdist_egg --dist-dir

Re: UNS: Re: cleaner ToscaWidgets

2007-10-24 Thread Alberto Valverde

Mike Orr wrote:
 On 10/24/07, John_Nowlan [EMAIL PROTECTED] wrote:
 -  could you add a bit relating the html to the code here? Not being an
 expert, I'm curious to know if things such as 'class=even' come from
 the ListForm class and/or whether this is fixed html output and/or
 expecting a related css. At the end of the tutorial you mention in the
 coming next: 'How to tweak the form's template to precisely control its
 layout.'  So maybe just say that here, i.e. add a paragraph above 'Using
 the form in your application' that says: The layout of the form can be
 customized. 'How to tweak..' will be the subject of a following
 tutorial.
 
 That's an important point that those of us familiar with CSS
 customizing can easily overlook.  Taking a *very* quick look at the
 article, you might do something like this.  (This itself may look ugly
 but it illustrates the point.)
 
 (...)
 
 Alberto, can we get a short stylesheet example in the tutorial?

Yep, was planning to do that when I cover tweaking the layout. Finally
didn't have time to start part 2 today but will tomorrow...

Alberto


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets and descending into pylons version of dll hell

2007-10-24 Thread Alberto Valverde

John_Nowlan wrote:
 Now trying to do the tutorial:
 
 (note: I had to update to python25 from 24 on windows because in trying
 to do the tutorial I was getting an error about a missing python25.dll
 after updating dependent packages (PasteDeploy-1.3.1, Beaker-0.8,
 Webhelpers-0.3.2, Routes-1.7). Updating to 25 without changing path
 fixed that problem.)

Hmmm, I'm not sure what might be causing this but at this point it
doesn't look TW related. Can't help you much here really since I have no
experience with pylons on windows.

 
 paster create -t Pylons TWTutorial - should be -paster create -t
 pylons TWTutorial
 - lowercase pylons not Pylons
 - otherwise you get 'LookupError: Template by name 'Pylons' not found'

Noticed and fixed that...

 
 - make the first few code changes, get to the first paster serve..:
 
 ( long traceback )


 ImportError: cannot import name sslerror
 
 stuck :(

Hmmm, looks something related to Paste's httpserver. AFAIK, it's the
only place where ssl related stuff is imported in Pylons' dependencies.

 So I try on a development unix box. (Fits in with the split
 personality...)
 Have to update setuptools...
 and ...
 
 $ easy_install twForms
 (.)
 ld: fatal: library -lpython2.5: not found
 ld: fatal: File processing errors. No output written to
 build/lib.solaris-2.9-sun4u-2.5/dispatch/_d_speedups.so
 error: Setup script exited with error: command '/import/bin/cc' failed
 with exit status 1

I have no experience with Solaris but it seems the linker can't locate
python's shared library. Setting some environment variable should do the
trick... You will also need python's header files somewhere the compiler
can find them too.

 So I'm stuck and maybe should be starting a new thread about what seems
 to me to be a pylons version of dll hell. But its probably my own
 inexperience.

Don't blame Pylons, it's TW's fault here... TW depends on a third-party
library (RuleDispatch) which is not pure python (ie: has C coded modules
for performance). You're not the first person being bitten by that :(

I plan to fix this some time soon by dropping that dependency
altogether...

For the meantime, I've built those troublesome eggs without the C
speedups and uploaded them at toscawidgets.org. Can you try installing
RuleDispatch before installing twForms/ToscaWidgets like this:

easy_install -f http://toscawidgets.org/download/wo_speedups RuleDispatch

(all in the same line)

If it works please report back so I can mention it in the tutorial :)

 
 I've just been doing easy_install -U pylons to get to 0.9.6.1 and
 updating packages as nescessary. Perhaps its better to delete everything
 and do a 'clean' easy_install pylons to try and make sure all packages
 are at the required levels?
 
 Does anyone have words of wisdom about installing pylons, python
 packages? I.e. does it make sense to clean out old versions or what are
 'best practices'?

I'd recommend using virtualenv or workingenv to create a sandbox to
install libraries. When it breaks badly I just wipe the sandbox away and
start over again (crude but works :) Note that you will not want to do
this in a production environment unless you have backups of all eggs
with the versions you know that work since it's sometimes hard to find
the exact outdated version of a library.

 Although looking at this again the unix problem is prolly a env problem,
 i.e. need to solve -lpython2.5: not found

The easy_install workaround I gave a few lines back should get you
going... however, this is going to bite you again whenever you try to
install a library that has C speedups and no pre-compiled library for
your platform so I'd recommend taking the time to fix it some time.

Alberto

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-23 Thread Mike Orr

On 10/22/07, Max Ischenko [EMAIL PROTECTED] wrote:


 On 10/23/07, Mike Orr [EMAIL PROTECTED] wrote:
   Glad to hear this. :) So maybe I should reduce the initial scope of the
   docs I have in mind and not dive directly into custom widgets but
   concentrate on how existing widgets are used?
 
  Yes.  Think in terms of somebody who has used another Python form
  library or has handcoded all their forms, and just wants to use the
  standard widgets at first.  They'll be curious about any special
  widgets TW provides such as a date picker, WSIWYG editor, combo box,
  enhanced file uploader, etc -- things they've had to struggle with or
  do without in their other libraries.  They don't want to build custom
  widgets yet; they just want to build forms that work.

  I'd say that even tutorial for a simple form (2-5 fields, nothing fancy)
 would work if it highlights how TW is different from other approaches, like
 handcoding, and what it can give you.

Good point.  Level 1: what Max said.  Level 2: TW's megawidgets.
Level 3: making your own widgets.  Level 4: making your own composite
widgets (if that is different).

-- 
Mike Orr [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-23 Thread Alberto Valverde

Mike Orr wrote:
 On 10/22/07, Max Ischenko [EMAIL PROTECTED] wrote:

 On 10/23/07, Mike Orr [EMAIL PROTECTED] wrote:
 Glad to hear this. :) So maybe I should reduce the initial scope of the
 docs I have in mind and not dive directly into custom widgets but
 concentrate on how existing widgets are used?
 Yes.  Think in terms of somebody who has used another Python form
 library or has handcoded all their forms, and just wants to use the
 standard widgets at first.  They'll be curious about any special
 widgets TW provides such as a date picker, WSIWYG editor, combo box,
 enhanced file uploader, etc -- things they've had to struggle with or
 do without in their other libraries.  They don't want to build custom
 widgets yet; they just want to build forms that work.
  I'd say that even tutorial for a simple form (2-5 fields, nothing fancy)
 would work if it highlights how TW is different from other approaches, like
 handcoding, and what it can give you.
 
 Good point.  Level 1: what Max said.  Level 2: TW's megawidgets.
 Level 3: making your own widgets.  Level 4: making your own composite
 widgets (if that is different).
 

Ok, sounds good... I'll post in this thread a draft level 12 [1]
tutorial later today.

Alberto

[1] Since using megawidgets, which I suppose refers to the WYSIWYG
editor et al, is no different from a user's POV than using a simple text
field.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-23 Thread Alberto Valverde

Alberto Valverde wrote:
 Mike Orr wrote:
 On 10/22/07, Max Ischenko [EMAIL PROTECTED] wrote:
 On 10/23/07, Mike Orr [EMAIL PROTECTED] wrote:
 Glad to hear this. :) So maybe I should reduce the initial scope of the
 docs I have in mind and not dive directly into custom widgets but
 concentrate on how existing widgets are used?
 Yes.  Think in terms of somebody who has used another Python form
 library or has handcoded all their forms, and just wants to use the
 standard widgets at first.  They'll be curious about any special
 widgets TW provides such as a date picker, WSIWYG editor, combo box,
 enhanced file uploader, etc -- things they've had to struggle with or
 do without in their other libraries.  They don't want to build custom
 widgets yet; they just want to build forms that work.
  I'd say that even tutorial for a simple form (2-5 fields, nothing fancy)
 would work if it highlights how TW is different from other approaches, like
 handcoding, and what it can give you.
 Good point.  Level 1: what Max said.  Level 2: TW's megawidgets.
 Level 3: making your own widgets.  Level 4: making your own composite
 widgets (if that is different).

 
 Ok, sounds good... I'll post in this thread a draft level 12 [1]
 tutorial later today.

Until I can log on to the wiki I've posted the tutorial at my blog:
http://albertovalverde.es/twforms_tutorial1.html

Feedback welcomed! :)

Alberto

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-23 Thread Max Ischenko
On 10/23/07, Alberto Valverde [EMAIL PROTECTED] wrote:


 Until I can log on to the wiki I've posted the tutorial at my blog:
 http://albertovalverde.es/twforms_tutorial1.html


Cool. I don't have time to read it thouroughly but I certainly will.

One remark I noticed:

We're importing the validators from the twForms' validators module. This
module includes all validators from FormEncode but overrides
UnicodeStringso it doesn't encode strings when converting from python.
This is needed
because Genshi and Mako need all strings to be unicode internally (or at
least be ascii encodable). 

I remember this issue back when I worked on TG but now I use stock
UnicodeString validators in my Pylons and it just works.

I checked the FE source and it does the encoding now:

def _from_python(self, value, state):
if hasattr(value, '__unicode__'):
value = unicode(value)
if isinstance(value, unicode):
return value.encode(self.outputEncoding)
return str(value)



-- 
Max Ischenko
http://www.developers.org.ua/ -- Ukrainian software developers community
http://maxischenko.in.ua/ -- my blog (Russian)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-23 Thread Ian Bicking

Max Ischenko wrote:
 One remark I noticed:
 
 We're importing the validators from the twForms' validators module. 
 This module includes all validators from FormEncode but overrides 
 UnicodeString so it doesn't encode strings when converting from python. 
 This is needed because Genshi and Mako need all strings to be unicode 
 internally (or at least be ascii encodable). 

I think I might have just changed this in the trunk (which I'm planning 
to release shortly), so maybe it's a moot issue.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-22 Thread Alberto Valverde

Philip Cooper wrote:
 Alberto Valverde at about 10/22/07 2:07 PM said:
 Max Ischenko wrote:
 Hello Mike,

 On 10/22/07, *Mike Orr* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:


 So, to toscawidget or not to toscawidget?  I'm about to write some
 forms soon.  
 
 I'm obviously biased in regards to this so I hope a happy user chimes in
 instead of giving my opinion. :)

 Wrks 4 me.  Turbogears is not great on documentation of widgets but 
 it's a not better than starting from scratch.  Things like date picker 
 and tinyMCE are not things I really want to recreate.
 I've started http://www.openvest.com/trac/wiki/ToscawidgetsInPylons 
 for my own edification. More to come later.
 
 
  - hard to use (basically no docs)
 
 Pretty easy to use.  Everytime someone writes a doc, it seems they are 
 already super-users so they jump right into creating a custom widget. 
   Too advanced if you don't know what magic is behind a basic widget. 
   Understanding how DataGrid works makes the whole tw world make sense 
 IMHO.

Glad to hear this. :) So maybe I should reduce the initial scope of the
docs I have in mind and not dive directly into custom widgets but
concentrate on how existing widgets are used?

Alberto

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: UNS: Re: cleaner ToscaWidgets

2007-10-22 Thread Max Ischenko
On 10/23/07, Mike Orr [EMAIL PROTECTED] wrote:

  Glad to hear this. :) So maybe I should reduce the initial scope of the
  docs I have in mind and not dive directly into custom widgets but
  concentrate on how existing widgets are used?

 Yes.  Think in terms of somebody who has used another Python form
 library or has handcoded all their forms, and just wants to use the
 standard widgets at first.  They'll be curious about any special
 widgets TW provides such as a date picker, WSIWYG editor, combo box,
 enhanced file uploader, etc -- things they've had to struggle with or
 do without in their other libraries.  They don't want to build custom
 widgets yet; they just want to build forms that work.


I'd say that even tutorial for a simple form (2-5 fields, nothing fancy)
would work if it highlights how TW is different from other approaches, like
handcoding, and what it can give you.


-- 
Max Ischenko
http://www.developers.org.ua/ -- Ukrainian software developers community
http://maxischenko.in.ua/ -- my blog (Russian)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---