[web2py] Re: Can web2py "front-end" an API?

2015-10-20 Thread Luis Valladares
What if you use a model-less aplication? thats the way we handled this, we 
have a web2py application that consumes a lot of microservices, this 
application doesnt have any DB object and doesnt use the dal, it makes HTTP 
request to the api inside the controllers (Using the python requests 
library), format it and send to the views.

El domingo, 18 de octubre de 2015, 0:55:50 (UTC-4:30), pbreit escribió:
>
> Is there an easy way to use web2py to "front-end" and API? What I mean by 
> that is that given a public API (for example, Stripe's API), could I write 
> some models that correspond to the API structure and then call the DAL as 
> if the API was a back-end DB? Does that make any sense?
>

-- 
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: Can web2py "front-end" an API?

2015-10-20 Thread Richard Vézina
Hmm... Model-Less application shouldn't be regarded as a web2py application
without model properly defined... Model-Less web2py application is just an
application written with web2py where the models are not defined in the
models/ folder of web2py to avoid cost of parsing models definition at each
request... So some web2py users have developped the model-less approach
that consist in the definition of the models into a modules which is then
imported once... That way database models are not parsed at each request
anymore... This is only required when your application need to scale up and
performance start of getting an issue and you should start thinking to
refactoring it to allow you app to support an raising charge related to the
popularity of your web2py site a webapp. It may be worth to consider
model-less approach also when you have many tables and the models files
parsing start of getting an issue...

Before take this path you really need to make sure what is the reason of
your performance issue by profiling you application properly to find the
bottle neck then start thinking on how you are going to resolve it and
refactor your app. Model-Less issue come with some penality in term of
web2py functionnalities, so you really want to take this path when you
really need to.

Further information about Model-Less :

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Model-less-applications
http://www.web2pyslices.com/slice/show/1479/model-less-apps-using-data-models-and-modules-in-web2py

Richard

On Tue, Oct 20, 2015 at 6:22 AM, Luis Valladares  wrote:

> What if you use a model-less aplication? thats the way we handled this, we
> have a web2py application that consumes a lot of microservices, this
> application doesnt have any DB object and doesnt use the dal, it makes HTTP
> request to the api inside the controllers (Using the python requests
> library), format it and send to the views.
>
>
> El domingo, 18 de octubre de 2015, 0:55:50 (UTC-4:30), pbreit escribió:
>>
>> Is there an easy way to use web2py to "front-end" and API? What I mean by
>> that is that given a public API (for example, Stripe's API), could I write
>> some models that correspond to the API structure and then call the DAL as
>> if the API was a back-end DB? Does that make any sense?
>>
> --
> 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: Can web2py "front-end" an API?

2015-10-20 Thread Anthony
I think it's clear that by "model-less," Luis meant no db/database model 
definitions (at least not with regard to third party API's). In the past, 
the term "model-less" has also been used to describe an architecture that 
avoids use of files in the /models folder. The term is ambiguous because a 
"model" can either be a file in the /models folder or a database model 
(defined anywhere).

On Tuesday, October 20, 2015 at 12:12:41 PM UTC-4, Richard wrote:
>
> Hmm... Model-Less application shouldn't be regarded as a web2py 
> application without model properly defined... Model-Less web2py application 
> is just an application written with web2py where the models are not defined 
> in the models/ folder of web2py to avoid cost of parsing models definition 
> at each request... So some web2py users have developped the model-less 
> approach that consist in the definition of the models into a modules which 
> is then imported once... That way database models are not parsed at each 
> request anymore... This is only required when your application need to 
> scale up and performance start of getting an issue and you should start 
> thinking to refactoring it to allow you app to support an raising charge 
> related to the popularity of your web2py site a webapp. It may be worth to 
> consider model-less approach also when you have many tables and the models 
> files parsing start of getting an issue...
>
> Before take this path you really need to make sure what is the reason of 
> your performance issue by profiling you application properly to find the 
> bottle neck then start thinking on how you are going to resolve it and 
> refactor your app. Model-Less issue come with some penality in term of 
> web2py functionnalities, so you really want to take this path when you 
> really need to.
>
> Further information about Model-Less :
>
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Model-less-applications
>
> http://www.web2pyslices.com/slice/show/1479/model-less-apps-using-data-models-and-modules-in-web2py
>
> Richard
>
> On Tue, Oct 20, 2015 at 6:22 AM, Luis Valladares <
> luisvalladare...@gmail.com> wrote:
>
>> What if you use a model-less aplication? thats the way we handled this, 
>> we have a web2py application that consumes a lot of microservices, this 
>> application doesnt have any DB object and doesnt use the dal, it makes HTTP 
>> request to the api inside the controllers (Using the python requests 
>> library), format it and send to the views.
>>
>>
>> El domingo, 18 de octubre de 2015, 0:55:50 (UTC-4:30), pbreit escribió:
>>>
>>> Is there an easy way to use web2py to "front-end" and API? What I mean 
>>> by that is that given a public API (for example, Stripe's API), could I 
>>> write some models that correspond to the API structure and then call the 
>>> DAL as if the API was a back-end DB? Does that make any sense?
>>>
>> -- 
>> 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: Can web2py "front-end" an API?

2015-10-19 Thread António Ramos
DAL as a webservice ? like a REST endpoint ?

There is something like that and i like it

http://loopback.io/


2015-10-18 13:48 GMT+01:00 Anthony :

> Maybe check out the IMAP adapter
>  for
> some ideas.
>
> Anthony
>
>
> On Sunday, October 18, 2015 at 1:25:50 AM UTC-4, pbreit wrote:
>>
>> Is there an easy way to use web2py to "front-end" and API? What I mean by
>> that is that given a public API (for example, Stripe's API), could I write
>> some models that correspond to the API structure and then call the DAL as
>> if the API was a back-end DB? Does that make any sense?
>>
> --
> 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: Can web2py "front-end" an API?

2015-10-19 Thread Massimo Di Pierro
yes. that would be really neat!

On Sunday, 18 October 2015 04:20:52 UTC-5, Leonel Câmara wrote:
>
> You could make a a DAL adapter yes. In fact one could argue that all DAL 
> adapters are facades for APIs.
>

-- 
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: Can web2py "front-end" an API?

2015-10-18 Thread Leonel Câmara
You could make a a DAL adapter yes. In fact one could argue that all DAL 
adapters are facades for APIs.

-- 
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: Can web2py "front-end" an API?

2015-10-18 Thread Anthony
Maybe check out the IMAP adapter 
 for 
some ideas.

Anthony

On Sunday, October 18, 2015 at 1:25:50 AM UTC-4, pbreit wrote:
>
> Is there an easy way to use web2py to "front-end" and API? What I mean by 
> that is that given a public API (for example, Stripe's API), could I write 
> some models that correspond to the API structure and then call the DAL as 
> if the API was a back-end DB? Does that make any sense?
>

-- 
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.