Initial import from Docker volume

This commit is contained in:
root
2025-12-26 13:11:43 +00:00
commit 4998dc066a
13336 changed files with 1767801 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
from . import routes, web
__all__ = ['register', 'routes']
def register():
Pool.register(
web.ShortenedURL,
web.URLAccess,
module='web_shortener', type_='model')
Pool.register(
module='web_shortener', type_='wizard')
Pool.register(
module='web_shortener', type_='report')

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Nombre de clics"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Mètode"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Registre"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "URL de redirecció"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "URL escurçada"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "URLs escurçades"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "URLs escurçades"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "URL curta"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "Accés URL"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Anzahl Klicks"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Methode"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Datensatz"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "URL Umleitung"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "Gekürzte URL"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "Gekürzte URLs"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "Gekürzte URLs"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "Gekürzte URL"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "URL Zugriff"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Número de clicks"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Método"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Registro"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "URL de redirección"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "URL acortada"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "URLs acortadas"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "URLs acortadas"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "URL corta"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "Acceso URL"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Klikid"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Meetod"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Kirje"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "Suunatud URL"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "Lühendatud URL"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "Lühendatud URL"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "Lühendatud URL"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "Lühike URL"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "URL-i juurdepääs"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Nombre de clics"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Méthode"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Enregistrement"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "URL de redirection"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "URL raccourcie"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "URLs raccourcies"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "URLs raccourcies"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "URL courte"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "Accès URL"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Metode"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Conteggio dei click"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Metodo"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Record"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "URL di rendirizzamento"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "URL abbreviato"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "URL abbreviati"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "URL abbreviati"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "URL breve"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "Accesso URL"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "aantal klikken"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Methode"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Record"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "Omleidings-URL"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "Verkorte URL"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "Verkorte URL"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "Verkorte URL"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "Korte URL"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "URL-toegang"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Contor Clickuri"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Metodă"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Înregistrare"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "Redirecționare URL"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "URL Prescurtat"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "URL-uri Prescurtate"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "URL-uri Prescurtate"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "URL Scurt"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "Access URL"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "Štetje klikov"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "Način"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "Zapis"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "URL za preusmeritev"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "Skrajšani URL"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "URL"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "Skrajšani URL-ji"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "Skrajšani URL-ji"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "Kratek URL"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "Dostop do URL-ja"

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr ""
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr ""
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr ""
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr ""
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr ""
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr ""
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr ""
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr ""
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr ""

View File

@@ -0,0 +1,43 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:web.shortened_url,count:"
msgid "Click Count"
msgstr "点击计数"
msgctxt "field:web.shortened_url,method:"
msgid "Method"
msgstr "方法"
msgctxt "field:web.shortened_url,record:"
msgid "Record"
msgstr "记录"
msgctxt "field:web.shortened_url,redirect_url:"
msgid "Redirect URL"
msgstr "重定向网址"
msgctxt "field:web.shortened_url,shortened_url:"
msgid "Shortened URL"
msgstr "网址短名"
msgctxt "field:web.shortened_url.access,url:"
msgid "URL"
msgstr "网址"
msgctxt "model:ir.action,name:act_shortened_url"
msgid "Shortened URLs"
msgstr "网址短名"
msgctxt "model:ir.ui.menu,name:menu_shortened_url_form"
msgid "Shortened URLs"
msgstr "网址短名"
msgctxt "model:web.shortened_url,name:"
msgid "Short URL"
msgstr "简短网址"
msgctxt "model:web.shortened_url.access,name:"
msgid "URL Access"
msgstr "URL访问"

20
modules/web_shortener/routes.py Executable file
View File

@@ -0,0 +1,20 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.protocols.wrappers import (
HTTPStatus, abort, redirect, with_pool, with_transaction)
from trytond.wsgi import app
@app.route('/s/<base64:database_name>$<shortened>')
@with_pool
@with_transaction(readonly=False)
def shortened(request, pool, shortened):
ShortenedURL = pool.get('web.shortened_url')
try:
shortened_url = ShortenedURL.get(shortened)
except IndexError:
abort(HTTPStatus.NOT_FOUND)
return redirect(shortened_url.access(), code=301)

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,30 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import random
import sys
from trytond.pool import Pool
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
class WebShortenerTestCase(ModuleTestCase):
'Test Web Shortener module'
module = 'web_shortener'
@with_transaction()
def test_shorten(self):
pool = Pool()
ShortenedURL = pool.get('web.shortened_url')
expand = ShortenedURL._expand
shorten = ShortenedURL._shorten
self.assertEqual(expand(shorten(0)), 0)
self.assertEqual(expand(shorten(sys.maxsize)), sys.maxsize)
for _ in range(10):
x = random.randint(0, sys.maxsize)
self.assertEqual(expand(shorten(x)), x)
del ModuleTestCase

View File

@@ -0,0 +1,6 @@
[tryton]
version=7.2.0
depends:
ir
xml:
web.xml

View File

@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="shortened_url"/>
<field name="shortened_url" widget="url"/>
<label name="redirect_url"/>
<field name="redirect_url" widget="url"/>
<label name="record"/>
<field name="record"/>
<label name="method"/>
<field name="method"/>
</form>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="shortened_url" widget="url" expand="1"/>
<field name="redirect_url" widget="url" expand="1"/>
<field name="count"/>
<field name="record" expand="1"/>
<field name="method" expand="1"/>
</tree>

131
modules/web_shortener/web.py Executable file
View File

@@ -0,0 +1,131 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import logging
import string
from urllib.parse import quote, urljoin
from sql.aggregate import Count
from trytond.config import config
from trytond.model import ModelSQL, ModelView, fields
from trytond.pool import Pool
from trytond.tools import grouped_slice, reduce_ids
from trytond.transaction import Transaction
from trytond.url import http_host
from trytond.wsgi import Base64Converter
ALPHABET = string.digits + string.ascii_lowercase
URL_BASE = config.get('web', 'shortener_base', default=http_host())
logger = logging.getLogger(__name__)
class ShortenedURL(ModelSQL, ModelView):
"Short URL"
__name__ = 'web.shortened_url'
shortened_url = fields.Function(
fields.Char("Shortened URL"), 'get_url')
redirect_url = fields.Char("Redirect URL", readonly=True, required=True)
record = fields.Reference("Record", selection='get_models', readonly=True)
method = fields.Selection('get_methods', "Method", readonly=True)
count = fields.Function(fields.Integer("Click Count"), 'get_count')
@classmethod
def get_url(cls, shortened_urls, name):
urls = {}
url_parts = {
'database': Base64Converter(None).to_url(
Transaction().database.name),
}
for shortened in shortened_urls:
url_parts['short_id'] = cls._shorten(shortened.id)
urls[shortened.id] = urljoin(
URL_BASE, quote('/s/%(database)s$%(short_id)s' % url_parts))
return urls
@classmethod
def get_count(cls, shortened_urls, name):
pool = Pool()
URLAccess = pool.get('web.shortened_url.access')
access = URLAccess.__table__()
cursor = Transaction().connection.cursor()
counts = {s.id: 0 for s in shortened_urls}
for sub_ids in grouped_slice(shortened_urls):
cursor.execute(*access.select(
access.url, Count(access.id),
where=reduce_ids(access.url, sub_ids),
group_by=[access.url]))
counts.update(cursor)
return counts
@classmethod
def _get_models(cls):
return []
@classmethod
def get_models(cls):
pool = Pool()
Model = pool.get('ir.model')
get_name = Model.get_name
models = cls._get_models()
return [(None, '')] + [(m, get_name(m)) for m in models]
@classmethod
def _get_methods(cls):
return []
@fields.depends('record')
def get_methods(self):
def func(option):
if not self.record:
return True
else:
name = option[0].split('|')[0]
return self.record.__class__.__name__ == name
return [(None, '')] + list(filter(func,
((m, m) for m in self._get_methods())))
@classmethod
def get(cls, shortened_id):
id = cls._expand(shortened_id)
return cls.search([('id', '=', id)], limit=1)[0]
def access(self, **values):
pool = Pool()
URLAccess = pool.get('web.shortened_url.access')
URLAccess(url=self, **values).save()
if self.record and self.method:
model, method = self.method.split('|')
if model == self.record.__class__.__name__:
method = getattr(self.record.__class__.__queue__, method)
method([self.record])
return self.redirect_url
@staticmethod
def _shorten(integer):
"Turns an integer into a string in a given alphabet"
key_part = []
while integer:
integer, remainder = divmod(integer, len(ALPHABET))
key_part.append(ALPHABET[remainder])
else:
if not key_part:
key_part.append('0')
return ''.join(reversed(key_part))
@staticmethod
def _expand(key):
"Turns a key from a given alphabet to the corresponding ID"
return int(key, len(ALPHABET))
class URLAccess(ModelSQL):
"URL Access"
__name__ = 'web.shortened_url.access'
url = fields.Many2One('web.shortened_url', "URL", required=True)

54
modules/web_shortener/web.xml Executable file
View File

@@ -0,0 +1,54 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="ir.ui.view" id="shortened_url_view_list">
<field name="model">web.shortened_url</field>
<field name="type">tree</field>
<field name="name">shortened_url_list</field>
</record>
<record model="ir.ui.view" id="shortened_url_view_form">
<field name="model">web.shortened_url</field>
<field name="type">form</field>
<field name="name">shortened_url_form</field>
</record>
<record model="ir.action.act_window" id="act_shortened_url">
<field name="name">Shortened URLs</field>
<field name="res_model">web.shortened_url</field>
</record>
<record model="ir.action.act_window.view" id="act_shortened_url_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="shortened_url_view_list"/>
<field name="act_window" ref="act_shortened_url"/>
</record>
<record model="ir.action.act_window.view" id="act_shortened_url_view2">
<field name="sequence" eval="20"/>
<field name="view" ref="shortened_url_view_form"/>
<field name="act_window" ref="act_shortened_url"/>
</record>
<menuitem
parent="ir.menu_models"
action="act_shortened_url"
sequence="50"
id="menu_shortened_url_form"/>
<record model="ir.model.access" id="access_shortened_url">
<field name="model">web.shortened_url</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<record model="ir.model.access" id="access_shortened_url_group_admin">
<field name="model">web.shortened_url</field>
<field name="group" ref="res.group_admin"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
</data>
</tryton>