Re: [web2py] Re: standalone templates

2019-02-26 Thread Carlos Cesar Caballero Díaz
We still are not working in models, we want to treat some rough edges 
first with controllers overriding and views. But it should be included 
as an app component (just like cache and session).


Greetings.

El 26/2/19 a las 12:41 a.m., Massimo Di Pierro escribió:

nice work. Have you used it with pydal?

On Monday, 25 February 2019 10:04:43 UTC-8, Carlos Cesar Caballero wrote:

Hi Massimo,sorry about the delay in responding, I was really busy
last week. There is a small example of what we get right now (now
using yatl) https://github.com/daxslab/mojito


BTW the new helpers and refactored code looks much better.

Greetings.

El 18/2/19 a las 1:49 p.m., Massimo Di Pierro escribió:

I did some more refactoring. :-)
not sanitizer and helpers (similar to web2py ones) are part of yatl

can you provide an example of how to use
https://github.com/daxslab/ron


On Sunday, 17 February 2019 19:30:59 UTC-8, Carlos Cesar
Caballero wrote:

Awesome!! I will test it ASAP. A colleague and I have been
playing with your idea of a bottle-based framework and it has
became a quite good exercise. So far right now we got this
https://github.com/daxslab/ron

Greetings.

El 17/2/19 a las 9:52 p.m., Massimo Di Pierro escribió:

Thanks for all your help with templates.

So far I have posted this:
https://pypi.org/project/yatl/
and this:
https://github.com/web2py/yatl

I could use some more help with testing. if we are good we
can switch web2py to use this.
-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues/list
 (Report Issues)
---
You received this message because you are subscribed to the
Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails
from it, send an email to
web2py+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout
.


-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues/list
 (Report Issues)
---
You received this message because you are subscribed to the
Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to web2py+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout
.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-02-25 Thread Massimo Di Pierro
nice work. Have you used it with pydal?

On Monday, 25 February 2019 10:04:43 UTC-8, Carlos Cesar Caballero wrote:
>
> Hi Massimo, sorry about the delay in responding, I was really busy last 
> week. There is a small example of what we get right now (now using yatl) 
> https://github.com/daxslab/mojito
>
> BTW the new helpers and refactored code looks much better.
>
> Greetings.
> El 18/2/19 a las 1:49 p.m., Massimo Di Pierro escribió:
>
> I did some more refactoring. :-)
> not sanitizer and helpers (similar to web2py ones) are part of yatl
>
> can you provide an example of how to use https://github.com/daxslab/ron
>
>
> On Sunday, 17 February 2019 19:30:59 UTC-8, Carlos Cesar Caballero wrote: 
>>
>> Awesome!! I will test it ASAP. A colleague and I have been playing with 
>> your idea of a bottle-based framework and it has became a quite good 
>> exercise. So far right now we got this https://github.com/daxslab/ron
>>
>> Greetings.
>> El 17/2/19 a las 9:52 p.m., Massimo Di Pierro escribió:
>>
>> Thanks for all your help with templates.
>>
>> So far I have posted this:
>> https://pypi.org/project/yatl/
>> and this:
>> https://github.com/web2py/yatl
>>
>> I could use some more help with testing. if we are good we can switch 
>> web2py to use this.
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-02-25 Thread Carlos Cesar Caballero Díaz
Hi Massimo,sorry about the delay in responding, I was really busy last 
week. There is a small example of what we get right now (now using yatl) 
https://github.com/daxslab/mojito


BTW the new helpers and refactored code looks much better.

Greetings.

El 18/2/19 a las 1:49 p.m., Massimo Di Pierro escribió:

I did some more refactoring. :-)
not sanitizer and helpers (similar to web2py ones) are part of yatl

can you provide an example of how to use https://github.com/daxslab/ron


On Sunday, 17 February 2019 19:30:59 UTC-8, Carlos Cesar Caballero wrote:

Awesome!! I will test it ASAP. A colleague and I have been playing
with your idea of a bottle-based framework and it has became a
quite good exercise. So far right now we got this
https://github.com/daxslab/ron

Greetings.

El 17/2/19 a las 9:52 p.m., Massimo Di Pierro escribió:

Thanks for all your help with templates.

So far I have posted this:
https://pypi.org/project/yatl/
and this:
https://github.com/web2py/yatl

I could use some more help with testing. if we are good we can
switch web2py to use this.
-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues/list
 (Report Issues)
---
You received this message because you are subscribed to the
Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to web2py+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout
.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-02-18 Thread Massimo Di Pierro
I did some more refactoring. :-)
not sanitizer and helpers (similar to web2py ones) are part of yatl

can you provide an example of how to use https://github.com/daxslab/ron


On Sunday, 17 February 2019 19:30:59 UTC-8, Carlos Cesar Caballero wrote:
>
> Awesome!! I will test it ASAP. A colleague and I have been playing with 
> your idea of a bottle-based framework and it has became a quite good 
> exercise. So far right now we got this https://github.com/daxslab/ron
>
> Greetings.
> El 17/2/19 a las 9:52 p.m., Massimo Di Pierro escribió:
>
> Thanks for all your help with templates.
>
> So far I have posted this:
> https://pypi.org/project/yatl/
> and this:
> https://github.com/web2py/yatl
>
> I could use some more help with testing. if we are good we can switch 
> web2py to use this.
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-02-17 Thread Carlos Cesar Caballero Díaz
Awesome!! I will test it ASAP. A colleague and I have been playing with 
your idea of a bottle-based framework and it has became a quite good 
exercise. So far right now we got this https://github.com/daxslab/ron


Greetings.

El 17/2/19 a las 9:52 p.m., Massimo Di Pierro escribió:

Thanks for all your help with templates.

So far I have posted this:
https://pypi.org/project/yatl/
and this:
https://github.com/web2py/yatl

I could use some more help with testing. if we are good we can switch 
web2py to use this.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-02-17 Thread Massimo Di Pierro
Thanks for all your help with templates.

So far I have posted this:
https://pypi.org/project/yatl/
and this:
https://github.com/web2py/yatl

I could use some more help with testing. if we are good we can switch 
web2py to use this.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-01-28 Thread Carlos Cesar Caballero Díaz
Nothing, but I was looking for a way that the user could directly call 
render and pass his own arguments and render the template with some 
objects passed to the environment by default. But don't worry, now I 
have included the possibility to use more than one template engine, so I 
will make some kind of wrapper function and include the defaults.


Greetings.

El 28/1/19 a las 11:14 a.m., Anthony escribió:
On Monday, January 28, 2019 at 8:45:53 AM UTC-5, Carlos Cesar 
Caballero wrote:


Hi Antony, Thanks. I am experimenting with the Massimo idea of a
bottle based framework using web2py components, And I was looking
if there was an equivalent of the jinja2 "Environment.globals".
The code is in https://github.com/daxslab/ron


Looks like you're using the render() function, so what's wrong with 
using the "context" argument to add globals to the template execution 
environment?


Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-01-28 Thread Anthony
On Monday, January 28, 2019 at 8:45:53 AM UTC-5, Carlos Cesar Caballero 
wrote:
>
> Hi Antony, Thanks. I am experimenting with the Massimo idea of a bottle 
> based framework using web2py components, And I was looking if there was an 
> equivalent of the jinja2 "Environment.globals". The code is in 
> https://github.com/daxslab/ron
>

Looks like you're using the render() function, so what's wrong with using 
the "context" argument to add globals to the template execution environment?

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-01-28 Thread Carlos Cesar Caballero Díaz
Hi Antony, Thanks. I am experimenting with the Massimo idea of a bottle 
based framework using web2py components, And I was looking if there was 
an equivalent of the jinja2 "Environment.globals". The code is in 
https://github.com/daxslab/ron


Greetings.



El 28/1/19 a las 8:16 a.m., Anthony escribió:
Can you show some code or describe in more detail what you are trying 
to do?


If you are using the render() function from gluon.template, note that 
it takes a context argument, which is a dictionary used to generate an 
execution environment. You can do:


|
ENV ={
'var1':'value 1',
'var2':'value 2'
}

output =render(filename='mytemplate.html',context=ENV)
|

In the template, you can then reference var1 and var2 (e.g., {{=var1}}).

If you want to create an environment similar to the web2py 
environment, have a look 
at https://github.com/web2py/web2py/blob/cef31f127796c638753297235f4e886f6a9e5410/gluon/compileapp.py#L387-L450 
to see how web2py sets up its environment.


Anthony

On Wednesday, January 23, 2019 at 8:09:34 AM UTC-5, Carlos Cesar 
Caballero wrote:


Hi guys, I am using the web2py templates in a side project and I
want to
include some variables in the environment by default, something
like how
helpers, request and response are included in the framework, but I
can't
find how this is done. Any idea?

Greetings.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: standalone templates

2019-01-28 Thread Anthony
Can you show some code or describe in more detail what you are trying to do?

If you are using the render() function from gluon.template, note that it 
takes a context argument, which is a dictionary used to generate an 
execution environment. You can do:

ENV = {
'var1': 'value 1',
'var2': 'value 2'
}

output = render(filename='mytemplate.html', context=ENV)

In the template, you can then reference var1 and var2 (e.g., {{=var1}}).

If you want to create an environment similar to the web2py environment, 
have a look 
at 
https://github.com/web2py/web2py/blob/cef31f127796c638753297235f4e886f6a9e5410/gluon/compileapp.py#L387-L450
 
to see how web2py sets up its environment.

Anthony

On Wednesday, January 23, 2019 at 8:09:34 AM UTC-5, Carlos Cesar Caballero 
wrote:
>
> Hi guys, I am using the web2py templates in a side project and I want to 
> include some variables in the environment by default, something like how 
> helpers, request and response are included in the framework, but I can't 
> find how this is done. Any idea? 
>
> Greetings. 
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: standalone templates

2019-01-27 Thread Carlos Cesar Caballero Díaz

Thanks a lot Leonel, I'm looking at it.

Greetings.


El 27/1/19 a las 6:11 a.m., Leonel Câmara escribió:

Carlos look at:

https://github.com/web2py/web2py/blob/master/gluon/compileapp.py

Specifically the funtion *run_view_in*
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: standalone templates

2019-01-27 Thread Leonel Câmara
Carlos look at:

https://github.com/web2py/web2py/blob/master/gluon/compileapp.py

Specifically the funtion *run_view_in*

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.