1) If you check it let me know. If I am wrong I would like to know.
Both ways I would find the output odd.
3) I agree. Whatever works for you. I am happy to help is needed.
Your example seems fine.
On Oct 12, 6:57 pm, pigmej <[EMAIL PROTECTED]> wrote:
> @massimo
>
> 1) You are wrong, I think :)
@massimo
1) You are wrong, I think :)
everything without {{block}} are processed automatically, but I can
manipulate everything in block content, remove it, add etc. It's
usefull
are you sure about this output ? I cannot check it now, but I expected
something like: abcyyyefghij
2) The real wik
Oops. Will fix it. Mind that T2 is still very much beta and the API
will change.
About jinja. Despite what I said above, I do understand this is very
much an issue of subjective preference. It should work out of the box
with web2py but, if you have any issue, I will be happy help you port
it to
This is good news. It you tells what we have to change to use the
latest ipython featues in shell.py I will make sure it gets packages
with the next .exe and .app. It would be great to have auto-completion
from the web2py shell.
Massimo
On Oct 12, 5:35 pm, yarko <[EMAIL PROTECTED]> wrote:
> actu
It makes big impression.
But in plugin_t2/modules/t2.py there is mix of '' (4 times space)
and tabs ( tabulations )... it shouldn't be :)
On 13 Paź, 01:03, yarko <[EMAIL PROTECTED]> wrote:
> Note - you can read all that wiki code in about maybe 3 minutes or
> less ;-)
>
> On Oct 12, 6:00 pm,
@pigmaj
yes there should be more docs. For now this recipe is on AlterEgo and
in the manual. I am looking into turning AlterEgo into a real wiki
very soon.
@yarko
Yes this is mainly a stylistic difference but there are two practical
differences:
1) in Django and Jinja you cannot use Python comma
I tried this view with no problems:
begin file index.html
{{extend 'layout.html'}}
{{submenu1=[
['item1',False,URL(r=request,f='item1')],
['item2',False,URL(r=request,f='item2')],
]
submenu2=[
['item3',False,URL(r=request,f='item3')],
['item4',False,URL(r=request,f='item4')],
]
response
Note - you can read all that wiki code in about maybe 3 minutes or
less ;-)
On Oct 12, 6:00 pm, pigmej <[EMAIL PROTECTED]> wrote:
> In Poland there is Monday 1 AM and... it's not sunny rotfl ;d
>
> On 13 Paź, 00:39, pigmej <[EMAIL PROTECTED]> wrote:
>
> > Thanks for naswers :)
>
> > In web2py I'm
In Poland there is Monday 1 AM and... it's not sunny rotfl ;d
On 13 Paź, 00:39, pigmej <[EMAIL PROTECTED]> wrote:
> Thanks for naswers :)
>
> In web2py I'm beginner. I generally don't like frameworks ( Django
> etc ). I prefer using routers, werkzeug or paser and jinja2 for
> templates, writing e
Given that, you may NOT want to put off T2 - it's just an abstraction
layer on top of web2py that makes a lot even easier (maybe so much
that it's hard at first??? LOL)
At least peruse the T2 example wiki (I am betting you'll have a
reaction) - download from here:
http://groups.google.com/grou
actually, getting this up from main is pretty easy; getting the app
context updated from an app, the way to set that up right might be a
little bit of stumbling I'll post when I have something
rudimentary - but won't look at again for a few days (alas).
On Oct 12, 5:03 pm, yarko <[EMAIL PR
understood
I was arguing that having something like {{exterior_finish(car) }}
is not any different than {{ car | pime | paint | bake | add_trim }}
that is - where the code sits...
But in the cases you meant, yes - {{my()}}
{{is_nicer_all_here()}}
Thanks.
As for multilne code: write "no
Thanks for naswers :)
In web2py I'm beginner. I generally don't like frameworks ( Django
etc ). I prefer using routers, werkzeug or paser and jinja2 for
templates, writing everything from scratch, etc. But for web2py I can
make exception. Let's see... ;)
On 13 Paź, 00:28, yarko <[EMAIL PROTECTED
...but you can already see all that from Massimo's nice, concise
examples,
and I should not be sitting reading posts on a sunny Sunday
afternoon! I'm sure not to say much of anything smart while looking
out the window ;-)
On Oct 12, 5:28 pm, yarko <[EMAIL PROTECTED]> wrote:
> understood
>
Now I see that I can make with web2py templates almost everything :).
Massimo, I really think, You should add this recipes to howto :)
@yarko:
sometimes there is no staight way to modify something in controller.
But ok, I modify it, and then i loop them again in template -> so
there are two loo
The license is a new or revised BSD license: it allows source or
binary distributions.
IPython is hosted on launchpad: https://launchpad.net/ipython
It's license file is in the COPYING file here:
http://bazaar.launchpad.net/~ipython-dev/ipython/trunk/files
On Oct 12, 4:37 pm, mdipierro <[EMA
mdipierro
thanks for showing way for blocks
I know that escaping is default and I think there should be something
to change it -> I know about XML method.
I know for syntax in web2py already :)
The short manual on site for templating is too small, I think.
Btw. Good work with web2py. PYTHON f
This looks like only a stylistic discussion to me
Django has this too, and Jinja you say have a "shell like" syntax of
"pipes" --- that is output of one operation feeds input of another.
n
{{ car | prime | paint }} is equivalent to {{ paint(prime(car)) }},
or for that matter {{ car.paint()
I think this is excellent and should be supported by the shell. If the
license permits it I would also like to have it included as default
shell in the binary distributions. Do you know?
Massimo
On Oct 12, 4:31 pm, yarko <[EMAIL PROTECTED]> wrote:
> I experimented yesterday a bit w/ IPython trun
Yes not very pythonic. I think the web2py way is more pythonic
blocks in layout.html:
{{myblockcode1()}} {{myblockcode2()}}
and in index.html:
{{def myblockcode1():}}Hello{{return}}
{{def myblockcode2():}}World{{return}}
{{extend 'layout.html'}}
escaping a string is the default
{{="some string"}
I experimented yesterday a bit w/ IPython trunk, to discover that Gaël
Varoquaux has written a wx based front end for IPython (IPythonx, and
IPtyon-wx, but I found the former at this point more interesting, as
it has nice, scrolling completion).
I tried to "quickly" hack up gluon/shell.py to see
massimo,
filters... ok but what if I need to make more operations with strings
etc, python operations, imports, parsing something ?
More lines of code.
For example I need to operate on dictionaries ( defining new, parsing
etc )
Theoretically, I can apply filters on controller side... but then
t
sure,
for example in base template I define "block", then in child template
I can modify content of this block, that's useful in many,many
situations.
Secondly. Custom filters. I write python function in any file, then I
add it to jinja env and after that I can use it as a normal filter in
templ
hey pros!
anyone tried above code and got same error?
or am i doing something (very) stupid?
any help great!!
tx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group,
You can do both:
1) Example of passing variables to parent.
Here is layout.html
{{=title}}{{include}}
and here is an example of index.html
{{title='something'}}
{{extend 'layout.html'}}
Hello World
Also are variables returned by the action and defined in models are
also pa
Maybe some examples would help me better understand what you mean by
these two points.
Could you give something short?
Thanks!
Yarko
On Oct 12, 3:42 pm, pigmej <[EMAIL PROTECTED]> wrote:
> thanks for reply.
>
> Python is templating engine - thats really good.
>
> But I can only include file in
thanks for reply.
Python is templating engine - thats really good.
But I can only include file in one place and there is no way to change
anything in parrent file. That's a minus, and the minor problem for
mine.
The same thing with filters/macros. I need to use the same macro/
filter in many fi
Yes you can as Yarko explains but:
1) your app will not be portable, since it will require the other
engine installed
2) You lose the ability to byte-code compile templates and distribute
them in a closed-source web2py app.
3) The current web2py template engine, because of bytecode compilation
an
Also - if you want to use Genshi Templates (or try to do something
similar for Jinja2), see the Genshi4web2py.py file and instructions
here:
http://mdp.cti.depaul.edu/AlterEgo/default/show/162
On Oct 12, 2:59 pm, yarko <[EMAIL PROTECTED]> wrote:
> There have been several discussions on this li
There have been several discussions on this list on the topic - for
example, look through
http://groups.google.com/group/web2py/browse_thread/thread/1ef4eea826f3a1f6/dc6d1b52b31fa196?hl=en&lnk=gst&q=template+engine#dc6d1b52b31fa196
I think a raesonable summary is:
- web2py's templating, being
Is there any way to change default template engine in web2py?
I would like to change it to something better with more features like
Jinja2
Or maybe there is a lot of undocumented things in default template
engine ?
--~--~-~--~~~---~--~~
You received this message
IS_LIST_OF does not apply to a single field but applies to the case
when you have multiple input fields with the same name. In this case
request.vars.fieldname contains a list of values (literally a python
list of strings, not a list in a string).
IS_LIST_OF(IS_INT_IN_RANGE(...)) would validate al
Massimo
Many thanks for your MY_VALIDATOR. It works fine and helps me
visualize writing my own validators. I still don't know what
IS_LIST_OF does though :-)
5 part days into learning web2py and python from scratch I think I
will leave t2 for a little while.
Thanks again,
Bill
On Oct 12, 5:2
or you may want to consider
from applications.plugin_t2.modules.t2 import T2
db.yourtable.yourtable.widget=T2.tag_widget(['red','green','blue'])
Masimo
On Oct 12, 10:50 am, mdipierro <[EMAIL PROTECTED]> wrote:
> class MY_VALIDATOR:
> def __init__(self,theset=['red','green'],error_message='
class MY_VALIDATOR:
def __init__(self,theset=['red','green'],error_message='ouch!'):
self.theset=theset
self.em=error_message
def _call_(self,value):
items=[x.strip() for x in value.split(',')]
for item in items:
if not item in self.theset: retu
This is intentional. It gives you an option.
On Oct 12, 7:23 am, billf <[EMAIL PROTECTED]> wrote:
> It seems the problem is that IS_IN_SET cannot be in a list.
>
> Although there is no specific example of [IS_IN_SET(['Y','N'])], there
> are examples that group several validators together in a lis
what if you are searching for records that have leading or training
spaces? (perhaps inserted by mistake)
On Oct 12, 5:42 am, vihang <[EMAIL PROTECTED]> wrote:
> just checked.. the search works fine now in t2,
>
> one more thing, the input box value would do well with .strip() added
> to remove w
Let me ask them. If you do not consider I break of agreement I would
not mind sending you my own PDF copy.
On Oct 12, 5:42 am, "Phyo Arkar" <[EMAIL PROTECTED]> wrote:
> I think u will have to pay for that ,. Massimo have no control over that i
> think.
>
> On Sun, Oct 12, 2008 at 6:21 AM, vihang
yes, static
On Oct 12, 5:37 am, "Phyo Arkar" <[EMAIL PROTECTED]> wrote:
> Dear massimo;
>
> Thanks now i got it working. What i am doing is a directory listing of the
> download folder.
>
> Where is a good place to put files thats for download purpose only? Static ?
> I put it there.
>
> I will
Can anyone help with the following?
I want to validate an input string like "red,green,blue" where all the
elements occur in a list,e.g.
['red','orange','yellow','green','blue','indigo','violet']
such that "red,green,blue" is valid and "puce,yellow" is invalid.
I was thinking that maybe IS_LIST
It seems the problem is that IS_IN_SET cannot be in a list.
Although there is no specific example of [IS_IN_SET(['Y','N'])], there
are examples that group several validators together in a list and also
[IS_NOT_EMPTY] (one validator in a list) so it seems a bit perverse
that if IS_IN_SET is in a l
It seems the problem is that IS_IN_SET cannot be in a list.
Although there is no specific example of [IS_IN_SET(['Y','N'])], there
are examples that group several validators together in a list and also
[IS_NOT_EMPTY] (one validator in a list) so it seems a bit perverse
that if IS_IN_SET is in a l
just checked.. the search works fine now in t2,
one more thing, the input box value would do well with .strip() added
to remove whitespaces... they are definitely a problem with the
search.. but I was just wondering that would it be useful if its added
to the framework... I cannot think of any in
I think u will have to pay for that ,. Massimo have no control over that i
think.
On Sun, Oct 12, 2008 at 6:21 AM, vihang <[EMAIL PROTECTED]> wrote:
>
> Hi Massimo,
>
> If we buy from vitalsource right now, can we also get the pdf version
> if/when its released later or do we have to pay for that
Dear massimo;
Thanks now i got it working. What i am doing is a directory listing of the
download folder.
Where is a good place to put files thats for download purpose only? Static ?
I put it there.
I will check appadmin.py.
On Sat, Oct 11, 2008 at 9:53 PM, mdipierro <[EMAIL PROTECTED]> wrote
My model contains:
db.define_table('recipe',
SQLField('last_action_ts','datetime',required=True,default=now),
SQLField('ability','string',length=1,required=True,requires=IS_IN_SET(['B','C'],labels=['straightforward','slightly
adventurous'])),
SQLField('amount','integer',require
46 matches
Mail list logo