trytond as a Django database backend

117 views
Skip to first unread message

M. Murray

unread,
Jul 12, 2016, 2:50:03 AM7/12/16
to tryton-contrib
Re-posting this here, original post located at https://groups.google.com/forum/#!topic/tryton/L6XVbatdtZY

We're already using Tryton and GNU Health - now we want to create some, initially simple, web-apps that will read and write data to trytond. The choice is between Django and Flask.

Use case 1: Web app runs in the public talking to trytond in a private network over XMLRPC or JSONRPC
In this case, Django and Flask on equal footing in terms of tryton integration - we need a client library.

Use case 2: Web app runs in the same server as trytond, accessible to people who also have tryton logins - flask-tryton gives flask an advantage here.

However, we feel that Flask is less nice than Django for building web-apps whose requirements are not fully known in the beginning.

For this reason, we have decided to build a custom Django Database Backend that uses trytond as it's database. It would work in two different ways, depending on the backend-class that you select. One backend class would talk to a remote trytond over jsonrpc and the other would talk to a local trytond by importing stuff from trytond.* (similar to how flask-tryton works).

Comments, warnings and suggestions please.

---
MM

Sergi Almacellas Abellana

unread,
Jul 12, 2016, 5:51:06 AM7/12/16
to tryton-...@googlegroups.com
El 12/07/16 a les 02:29, M. Murray ha escrit:
> Re-posting this here, original post located
> at https://groups.google.com/forum/#!topic/tryton/L6XVbatdtZY
>
> We're already using Tryton and GNU Health - now we want to create some,
> initially simple, web-apps that will read and write data to trytond. The
> choice is between Django and Flask.
>
> Use case 1: Web app runs in the public talking to trytond in a private
> network over XMLRPC or JSONRPC
> In this case, Django and Flask on equal footing in terms of tryton
> integration - we need a client library.

Have you though about using flask-tryton accessing a database on another
server? this will be possible if you deploy the trytond code on the
server running the web app and allow access on the database from the
other server.
>
> Use case 2: Web app runs in the same server as trytond, accessible to
> people who also have tryton logins - flask-tryton gives flask an
> advantage here.
>
> However, we feel that Flask is less nice than Django for building
> web-apps whose requirements are not fully known in the beginning.
>
> For this reason, we have decided to build a custom Django Database
> Backend that uses trytond as it's database. It would work in two
> different ways, depending on the backend-class that you select. One
> backend class would talk to a remote trytond over jsonrpc and the other
> would talk to a local trytond by importing stuff from trytond.* (similar
> to how flask-tryton works).

I don't know so much about django backends, but IMHO this is reinventing
the wheel, so I will prefer using flask-tryton (which is already
mantained) instead of building a new backend from the scratch that you
will have to maintain.

>
> Comments, warnings and suggestions please.
>
> ---
> MM
>
> --
> You received this message because you are subscribed to the Google
> Groups "tryton-contrib" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/tryton-contrib/73768e3c-0fde-4830-b544-7bbf8e12b724%40googlegroups.com
> <https://groups.google.com/d/msgid/tryton-contrib/73768e3c-0fde-4830-b544-7bbf8e12b724%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

E Boer

unread,
Jul 13, 2016, 3:10:05 AM7/13/16
to tryton-contrib
You can use Nereid (https://github.com/fulfilio/nereid) which called itself "Nereid is a web framework built over Flask, with Tryton as an ORM."

Reply all
Reply to author
Forward
0 new messages