├── .gitignore
├── .gitmodules
├── README.md
├── docs
├── Makefile
├── make.bat
└── source
│ ├── _static
│ └── imgs
│ │ ├── apps-inheritance
│ │ ├── app-one.png
│ │ ├── app-two.png
│ │ ├── inheritance.png
│ │ ├── inheritance_v2.png
│ │ ├── inheritance_v3.png
│ │ └── multiple-inheritance.png
│ │ ├── basewidget.png
│ │ ├── controls
│ │ ├── autocomplete.png
│ │ ├── boundingslider.png
│ │ ├── button.png
│ │ ├── calendar.png
│ │ ├── checkbox.png
│ │ ├── combobox.png
│ │ ├── date.png
│ │ ├── datetime.png
│ │ ├── file.png
│ │ ├── fileupload.png
│ │ ├── image.png
│ │ ├── integer.png
│ │ ├── label.png
│ │ ├── linechart.png
│ │ ├── multiselection.png
│ │ ├── password.png
│ │ ├── player.png
│ │ ├── slider.png
│ │ ├── text.png
│ │ └── textarea.png
│ │ ├── db-apps-1.png
│ │ ├── db-apps-2.png
│ │ ├── demo-app.png
│ │ ├── first-app.png
│ │ ├── formsets-segment-sidebyside.png
│ │ ├── kunoleco.svg
│ │ ├── model-admin.png
│ │ ├── model-edit.png
│ │ ├── model-view.png
│ │ ├── orquestra-layers.png
│ │ ├── orquestra-layout.png
│ │ ├── orquestra.jpg
│ │ ├── orquestra.svg
│ │ ├── pyforms-gui.jpg
│ │ ├── pyforms-layers-gui.svg
│ │ ├── pyforms-layers-terminal.png
│ │ ├── pyforms-layers-terminal.svg
│ │ ├── pyforms-layers-web.png
│ │ ├── pyforms-layers-web.svg
│ │ ├── pyforms-layers.svg
│ │ ├── pyforms-terminal-small.jpg
│ │ ├── pyforms-terminal.jpg
│ │ ├── pyforms-web-com.png
│ │ ├── pyforms-web-small.jpg
│ │ ├── pyforms-web.jpg
│ │ ├── pyforms.jpg
│ │ ├── rtd.png
│ │ ├── star.png
│ │ ├── terminal-example-computervisionalgorithm.png
│ │ ├── terminal-example.png
│ │ └── web-example-computervisionalgorithm.png
│ ├── api-reference
│ ├── javascript
│ │ ├── basewidget.rst
│ │ ├── controls.rst
│ │ ├── index.rst
│ │ └── pyforms.rst
│ ├── overview.rst
│ └── python
│ │ ├── basewidget.rst
│ │ ├── controls.rst
│ │ ├── index.rst
│ │ └── widgets
│ │ └── django.rst
│ ├── conf.py
│ ├── getting-started
│ ├── advance-db.rst
│ ├── apps-inheritance.rst
│ ├── apps-permissions.rst
│ ├── db-apps.rst
│ ├── first-app.rst
│ ├── formset.rst
│ └── installing.rst
│ ├── index.rst
│ ├── local_settings.py
│ ├── orquestra
│ ├── customize.rst
│ ├── index.rst
│ ├── orquestra-layers.drawio
│ └── orquestra-layout.drawio
│ └── overview.rst
├── environment.yml
├── pyforms
├── __init__.py
├── basewidget.py
├── controls.py
├── dialogs.py
└── settings.py
├── pyforms_web
├── __init__.py
├── allcontrols.py
├── appmanager.py
├── basewidget.py
├── controls
│ ├── __init__.py
│ ├── control_autocomplete.py
│ ├── control_barschart.py
│ ├── control_base.py
│ ├── control_boundingslider.py
│ ├── control_breadcrumb.py
│ ├── control_button.py
│ ├── control_calendar.py
│ ├── control_checkbox.py
│ ├── control_checkboxlist.py
│ ├── control_checkboxlistquery.py
│ ├── control_codemirror.py
│ ├── control_combo.py
│ ├── control_date.py
│ ├── control_datetime.py
│ ├── control_decimal.py
│ ├── control_dir.py
│ ├── control_email.py
│ ├── control_emptywidget.py
│ ├── control_feed.py
│ ├── control_file.py
│ ├── control_fileupload.py
│ ├── control_float.py
│ ├── control_html.py
│ ├── control_image.py
│ ├── control_img.py
│ ├── control_integer.py
│ ├── control_itemslist.py
│ ├── control_label.py
│ ├── control_linechart.py
│ ├── control_list.py
│ ├── control_menu.py
│ ├── control_multiplechecks.py
│ ├── control_multipleselection.py
│ ├── control_multipleselectionquery.py
│ ├── control_multipleupload.py
│ ├── control_organogram.py
│ ├── control_password.py
│ ├── control_piechart.py
│ ├── control_player.py
│ ├── control_playerjs.py
│ ├── control_progress.py
│ ├── control_querycards.py
│ ├── control_querycombo.py
│ ├── control_queryitem.py
│ ├── control_querylist.py
│ ├── control_search.py
│ ├── control_simplelabel.py
│ ├── control_slider.py
│ ├── control_template.py
│ ├── control_text.py
│ ├── control_textarea.py
│ ├── control_timeout.py
│ ├── control_tree.py
│ ├── control_visvis.py
│ └── control_workflow.py
├── organizers.py
├── settings.py
├── utils.py
├── web
│ ├── __init__.py
│ ├── applications.py
│ ├── filesbrowser.py
│ ├── fixtures
│ │ ├── __init__.py
│ │ └── conf-allauth-site.json
│ ├── management
│ │ ├── __init__.py
│ │ ├── commands
│ │ │ ├── __init__.py
│ │ │ └── export_pyforms_apps.py
│ │ └── pyforms_app_template.py
│ ├── middleware
│ │ ├── __init__.py
│ │ ├── apps_2_update.py
│ │ └── middleware.py
│ ├── static
│ │ ├── base64.js
│ │ ├── canvas-video-player.js
│ │ ├── codemirror
│ │ │ ├── autorefresh.js
│ │ │ ├── codemirror.css
│ │ │ ├── codemirror.js
│ │ │ ├── css.js
│ │ │ ├── htmlmixed.js
│ │ │ ├── javascript.js
│ │ │ └── xml.js
│ │ ├── datetimepicker
│ │ │ ├── jquery.datetimepicker.full.min.js
│ │ │ └── jquery.datetimepicker.min.css
│ │ ├── filer
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── assets
│ │ │ │ └── fonts
│ │ │ │ │ └── jquery.filer-icons
│ │ │ │ │ ├── jquery-filer-preview.html
│ │ │ │ │ ├── jquery-filer.css
│ │ │ │ │ ├── jquery-filer.eot
│ │ │ │ │ ├── jquery-filer.svg
│ │ │ │ │ ├── jquery-filer.ttf
│ │ │ │ │ └── jquery-filer.woff
│ │ │ ├── bower.json
│ │ │ ├── css
│ │ │ │ ├── jquery.filer-dragdropbox-theme.css
│ │ │ │ └── jquery.filer.css
│ │ │ ├── examples
│ │ │ │ ├── default
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── js
│ │ │ │ │ │ └── custom.js
│ │ │ │ │ └── php
│ │ │ │ │ │ └── form_upload.php
│ │ │ │ └── dragdrop
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── js
│ │ │ │ │ └── custom.js
│ │ │ │ │ └── php
│ │ │ │ │ ├── ajax_remove_file.php
│ │ │ │ │ └── ajax_upload_file.php
│ │ │ ├── index.html
│ │ │ ├── js
│ │ │ │ ├── jquery.filer.js
│ │ │ │ └── jquery.filer.min.js
│ │ │ ├── package.json
│ │ │ └── php
│ │ │ │ ├── class.uploader.php
│ │ │ │ └── readme.txt
│ │ ├── gmaps.min.js
│ │ ├── jqplot
│ │ │ ├── excanvas.js
│ │ │ ├── jquery.jqplot.css
│ │ │ ├── jquery.jqplot.js
│ │ │ ├── jquery.jqplot.min.css
│ │ │ ├── jquery.jqplot.min.js
│ │ │ ├── jquery.js
│ │ │ ├── jquery.min.js
│ │ │ └── plugins
│ │ │ │ ├── jqplot.BezierCurveRenderer.js
│ │ │ │ ├── jqplot.barRenderer.js
│ │ │ │ ├── jqplot.blockRenderer.js
│ │ │ │ ├── jqplot.bubbleRenderer.js
│ │ │ │ ├── jqplot.canvasAxisLabelRenderer.js
│ │ │ │ ├── jqplot.canvasAxisTickRenderer.js
│ │ │ │ ├── jqplot.canvasOverlay.js
│ │ │ │ ├── jqplot.canvasTextRenderer.js
│ │ │ │ ├── jqplot.categoryAxisRenderer.js
│ │ │ │ ├── jqplot.ciParser.js
│ │ │ │ ├── jqplot.cursor.js
│ │ │ │ ├── jqplot.dateAxisRenderer.js
│ │ │ │ ├── jqplot.donutRenderer.js
│ │ │ │ ├── jqplot.dragable.js
│ │ │ │ ├── jqplot.enhancedLegendRenderer.js
│ │ │ │ ├── jqplot.enhancedPieLegendRenderer.js
│ │ │ │ ├── jqplot.funnelRenderer.js
│ │ │ │ ├── jqplot.highlighter.js
│ │ │ │ ├── jqplot.json2.js
│ │ │ │ ├── jqplot.logAxisRenderer.js
│ │ │ │ ├── jqplot.mekkoAxisRenderer.js
│ │ │ │ ├── jqplot.mekkoRenderer.js
│ │ │ │ ├── jqplot.meterGaugeRenderer.js
│ │ │ │ ├── jqplot.mobile.js
│ │ │ │ ├── jqplot.ohlcRenderer.js
│ │ │ │ ├── jqplot.pieRenderer.js
│ │ │ │ ├── jqplot.pointLabels.js
│ │ │ │ ├── jqplot.pyramidAxisRenderer.js
│ │ │ │ ├── jqplot.pyramidGridRenderer.js
│ │ │ │ ├── jqplot.pyramidRenderer.js
│ │ │ │ └── jqplot.trendline.js
│ │ ├── jquery-ui
│ │ │ ├── AUTHORS.txt
│ │ │ ├── LICENSE.txt
│ │ │ ├── external
│ │ │ │ └── jquery
│ │ │ │ │ └── jquery.js
│ │ │ ├── images
│ │ │ │ ├── ui-icons_444444_256x240.png
│ │ │ │ ├── ui-icons_555555_256x240.png
│ │ │ │ ├── ui-icons_777620_256x240.png
│ │ │ │ ├── ui-icons_777777_256x240.png
│ │ │ │ ├── ui-icons_cc0000_256x240.png
│ │ │ │ └── ui-icons_ffffff_256x240.png
│ │ │ ├── index.html
│ │ │ ├── jquery-ui.css
│ │ │ ├── jquery-ui.js
│ │ │ ├── jquery-ui.min.css
│ │ │ ├── jquery-ui.min.js
│ │ │ ├── jquery-ui.structure.css
│ │ │ ├── jquery-ui.structure.min.css
│ │ │ ├── jquery-ui.theme.css
│ │ │ ├── jquery-ui.theme.min.css
│ │ │ └── package.json
│ │ ├── jquery.flowchart
│ │ │ ├── MIT-LICENSE.txt
│ │ │ ├── README.md
│ │ │ ├── flowchart.jquery.json
│ │ │ ├── jquery.flowchart.css
│ │ │ ├── jquery.flowchart.js
│ │ │ ├── jquery.flowchart.min.css
│ │ │ ├── jquery.flowchart.min.js
│ │ │ ├── jquery.mousewheel.min.js
│ │ │ ├── jquery.panzoom.min.js
│ │ │ └── package.json
│ │ ├── jquery.json-2.4.min.js
│ │ ├── jquery.min.js
│ │ ├── pyforms.css
│ │ ├── pyforms.js
│ │ ├── pyformsjs
│ │ │ ├── BaseWidget.js
│ │ │ ├── ControlAutoComplete.js
│ │ │ ├── ControlBarsChart.js
│ │ │ ├── ControlBase.js
│ │ │ ├── ControlBoundingSlider.js
│ │ │ ├── ControlBreadcrumb.js
│ │ │ ├── ControlButton.js
│ │ │ ├── ControlCalendar.js
│ │ │ ├── ControlCheckBox.js
│ │ │ ├── ControlCheckBoxList.js
│ │ │ ├── ControlCheckBoxListQuery.js
│ │ │ ├── ControlCodeMirror.js
│ │ │ ├── ControlCombo.js
│ │ │ ├── ControlDate.js
│ │ │ ├── ControlDateTime.js
│ │ │ ├── ControlDir.js
│ │ │ ├── ControlEmail.js
│ │ │ ├── ControlEmptyWidget.js
│ │ │ ├── ControlFeed.js
│ │ │ ├── ControlFile.js
│ │ │ ├── ControlFileUpload.js
│ │ │ ├── ControlFloat.js
│ │ │ ├── ControlHtml.js
│ │ │ ├── ControlImage.js
│ │ │ ├── ControlImg.js
│ │ │ ├── ControlInteger.js
│ │ │ ├── ControlItemsList.js
│ │ │ ├── ControlLabel.js
│ │ │ ├── ControlLineChart.js
│ │ │ ├── ControlList.js
│ │ │ ├── ControlMenu.js
│ │ │ ├── ControlMultipleChecks.js
│ │ │ ├── ControlMultipleSelection.js
│ │ │ ├── ControlMultipleUpload.js
│ │ │ ├── ControlOrganogram.js
│ │ │ ├── ControlPassword.js
│ │ │ ├── ControlPieChart.js
│ │ │ ├── ControlPlayer.js
│ │ │ ├── ControlPlayerJs.js
│ │ │ ├── ControlProgress.js
│ │ │ ├── ControlQueryCards.js
│ │ │ ├── ControlQueryCombo.js
│ │ │ ├── ControlQueryList.js
│ │ │ ├── ControlSearch.js
│ │ │ ├── ControlSimpleLabel.js
│ │ │ ├── ControlSlider.js
│ │ │ ├── ControlTemplate.js
│ │ │ ├── ControlText.js
│ │ │ ├── ControlTextArea.js
│ │ │ ├── ControlTimeout.js
│ │ │ ├── ControlTree.js
│ │ │ ├── ControlVisVis.js
│ │ │ ├── ControlWorkflow.js
│ │ │ ├── pyforms-hub.js
│ │ │ └── pyforms.js
│ │ ├── timeline
│ │ │ ├── event.js
│ │ │ ├── graph.js
│ │ │ ├── timeline.js
│ │ │ └── track.js
│ │ ├── treant
│ │ │ ├── Treant.css
│ │ │ └── Treant.js
│ │ ├── video-js.css
│ │ └── video.js
│ ├── templates
│ │ └── pyforms-dependencies.html
│ ├── templatetags
│ │ ├── __init__.py
│ │ └── pyforms.py
│ ├── urls.py
│ └── views.py
└── widgets
│ ├── __init__.py
│ └── django
│ ├── __init__.py
│ ├── modeladmin.py
│ ├── modelform.py
│ ├── modelviewform.py
│ └── utils.py
├── readthedocs.yml
├── setup.py
├── tutorials
├── tutorial_advance_db
│ ├── apps-cache
│ │ └── None-
│ │ │ ├── a3da156a8-0837-4538-ac9b-8b21542085e3.app
│ │ │ ├── a52acb200-4a59-44d0-8191-8af0b42cc08e.app
│ │ │ ├── a5410d357-c910-41e8-931f-317b5c13dffa.app
│ │ │ ├── a55274747-4a12-4ecc-b436-29f03107c29a.app
│ │ │ ├── ab4682e34-c3fe-4b0c-a345-95fee1dcee19.app
│ │ │ ├── tutorial-departments-app.app
│ │ │ ├── tutorial-deptemp-app.app
│ │ │ ├── tutorial-deptmanager-app.app
│ │ │ ├── tutorial-employees-app.app
│ │ │ └── tutorial-titles-app.app
│ ├── lockfile.txt
│ ├── manage.py
│ ├── tutorial
│ │ └── models.py
│ ├── tutorial_advance_db
│ │ ├── __init__.py
│ │ ├── asgi.py
│ │ ├── settings.py
│ │ ├── urls.py
│ │ └── wsgi.py
│ └── tutorial_apps
│ │ ├── __init__.py
│ │ └── apps
│ │ ├── __init__.py
│ │ ├── departments_app.py
│ │ ├── deptemp_app.py
│ │ ├── deptmanager_app.py
│ │ ├── employees_app.py
│ │ ├── salaries_app.py
│ │ └── titles_app.py
└── tutorial_inheritance
│ ├── db.sqlite3
│ ├── local_settings.py
│ ├── lockfile.txt
│ ├── manage.py
│ ├── tutorial
│ ├── __init__.py
│ └── apps
│ │ ├── __init__.py
│ │ ├── app_one.py
│ │ ├── app_two.py
│ │ ├── inheritance.py
│ │ ├── inheritance_v2.py
│ │ ├── inheritance_v3.py
│ │ ├── multiple_inheritance.py
│ │ └── open_inheritancev3.py
│ └── tutorial_inheritance
│ ├── __init__.py
│ ├── asgi.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
└── utilities
└── merge-js.py
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | docs/build/
3 |
4 | *.pyc
5 |
6 | docs/\.DS_Store
7 |
8 | \.DS_Store
9 |
10 | PyForms_Web\.egg-info/
11 |
12 | build/
13 |
14 | dist/
15 |
16 | tutorials/tutorial_inheritance/apps-cache/
17 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "orquestra"]
2 | path = orquestra
3 | url = https://github.com/UmSenhorQualquer/orquestra.git
4 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | SPHINXPROJ = PyformsWeb
8 | SOURCEDIR = source
9 | BUILDDIR = build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
--------------------------------------------------------------------------------
/docs/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | pushd %~dp0
4 |
5 | REM Command file for Sphinx documentation
6 |
7 | if "%SPHINXBUILD%" == "" (
8 | set SPHINXBUILD=sphinx-build
9 | )
10 | set SOURCEDIR=source
11 | set BUILDDIR=build
12 | set SPHINXPROJ=PyformsWeb
13 |
14 | if "%1" == "" goto help
15 |
16 | %SPHINXBUILD% >NUL 2>NUL
17 | if errorlevel 9009 (
18 | echo.
19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20 | echo.installed, then set the SPHINXBUILD environment variable to point
21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
22 | echo.may add the Sphinx directory to PATH.
23 | echo.
24 | echo.If you don't have Sphinx installed, grab it from
25 | echo.http://sphinx-doc.org/
26 | exit /b 1
27 | )
28 |
29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30 | goto end
31 |
32 | :help
33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34 |
35 | :end
36 | popd
37 |
--------------------------------------------------------------------------------
/docs/source/_static/imgs/apps-inheritance/app-one.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/apps-inheritance/app-one.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/apps-inheritance/app-two.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/apps-inheritance/app-two.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/apps-inheritance/inheritance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/apps-inheritance/inheritance.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/apps-inheritance/inheritance_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/apps-inheritance/inheritance_v2.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/apps-inheritance/inheritance_v3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/apps-inheritance/inheritance_v3.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/apps-inheritance/multiple-inheritance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/apps-inheritance/multiple-inheritance.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/basewidget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/basewidget.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/autocomplete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/autocomplete.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/boundingslider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/boundingslider.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/button.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/calendar.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/checkbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/checkbox.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/combobox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/combobox.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/date.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/datetime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/datetime.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/file.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/fileupload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/fileupload.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/image.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/integer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/integer.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/label.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/label.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/linechart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/linechart.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/multiselection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/multiselection.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/password.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/player.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/player.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/slider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/slider.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/text.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/controls/textarea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/controls/textarea.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/db-apps-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/db-apps-1.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/db-apps-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/db-apps-2.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/demo-app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/demo-app.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/first-app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/first-app.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/formsets-segment-sidebyside.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/formsets-segment-sidebyside.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/model-admin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/model-admin.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/model-edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/model-edit.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/model-view.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/model-view.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/orquestra-layers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/orquestra-layers.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/orquestra-layout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/orquestra-layout.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/orquestra.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/orquestra.jpg
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-gui.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-gui.jpg
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-layers-terminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-layers-terminal.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-layers-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-layers-web.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-terminal-small.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-terminal-small.jpg
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-terminal.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-terminal.jpg
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-web-com.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-web-com.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-web-small.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-web-small.jpg
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms-web.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms-web.jpg
--------------------------------------------------------------------------------
/docs/source/_static/imgs/pyforms.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/pyforms.jpg
--------------------------------------------------------------------------------
/docs/source/_static/imgs/rtd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/rtd.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/star.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/terminal-example-computervisionalgorithm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/terminal-example-computervisionalgorithm.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/terminal-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/terminal-example.png
--------------------------------------------------------------------------------
/docs/source/_static/imgs/web-example-computervisionalgorithm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/docs/source/_static/imgs/web-example-computervisionalgorithm.png
--------------------------------------------------------------------------------
/docs/source/api-reference/javascript/basewidget.rst:
--------------------------------------------------------------------------------
1 | ***************
2 | BaseWidget
3 | ***************
4 |
5 | .. js:autoclass:: BaseWidget
6 | :members:
--------------------------------------------------------------------------------
/docs/source/api-reference/javascript/controls.rst:
--------------------------------------------------------------------------------
1 | ***************
2 | Controls
3 | ***************
4 |
5 |
6 | Every Control implemented in Python as a **javascript class** responsible for handling the Control in the client side. All these controls inherit from the ControlBase class.
7 |
8 | .. js:autoclass:: ControlBase
9 | :members:
--------------------------------------------------------------------------------
/docs/source/api-reference/javascript/index.rst:
--------------------------------------------------------------------------------
1 | ************
2 | Javascript
3 | ************
4 |
5 |
6 |
7 | .. toctree::
8 | :titlesonly:
9 |
10 | basewidget
11 | controls
12 | pyforms
13 |
--------------------------------------------------------------------------------
/docs/source/api-reference/javascript/pyforms.rst:
--------------------------------------------------------------------------------
1 | ***************
2 | PyformsManager
3 | ***************
4 |
5 | .. note::
6 |
7 | Located in the **pyforms.js** file.
8 |
9 | .. js:autoclass:: PyformsManager
10 | :members:
11 |
12 |
13 | ********************
14 | Other functions
15 | ********************
16 |
17 | .. note::
18 |
19 | Located in the **pyforms-hub.js** file.
20 |
21 | .. js:autofunction:: error_msg
22 |
23 | .. js:autofunction:: run_application
24 |
25 | .. js:autofunction:: pyforms_checkhash
--------------------------------------------------------------------------------
/docs/source/api-reference/overview.rst:
--------------------------------------------------------------------------------
1 | *********
2 | Overview
3 | *********
4 |
5 | Pyforms web works by having on the client side a javascript layer handeling all the Widgets and Controls updates occurred on the server side.
6 | The Widgets and Controls updates are exchanged using the functions **serialize** and **deserialize** on the client side and the **serialize_form** and **deserialize_form** on the server side. Only updated controls are communicated from one side to the other.
7 |
8 | Python when running in a Apache2 does not maintain in memory the objects created in each HTTP request, therefore everytime there is an update to a Widget, one is dumped to the disk and loaded when a new HTTP request arrive.
9 |
10 | .. image:: /_static/imgs/pyforms-web-com.png
11 | :align: center
--------------------------------------------------------------------------------
/docs/source/api-reference/python/basewidget.rst:
--------------------------------------------------------------------------------
1 | ***************************
2 | :mod:`BaseWidget`
3 | ***************************
4 |
5 | .. module:: pyforms_web.basewidget
6 | :synopsis: Bpod board
7 |
8 | .. image:: /_static/imgs/basewidget.png
9 | :width: 700px
10 | :align: center
11 |
12 | --------
13 | Overview
14 | --------
15 |
16 | The BaseWidget class is the base class of all pyforms applications.
17 |
18 | --------------
19 | API
20 | --------------
21 |
22 | .. autoclass:: pyforms_web.basewidget.BaseWidget
23 | :members:
24 | :undoc-members:
25 | :show-inheritance:
26 | :exclude-members: generate_segment,generate_segments,generate_tabs,generate_control,save_form,load_form,save_window,load_window,load_form_filename,before_close_event,mainmenu,visible,js
27 |
28 |
--------------------------------------------------------------------------------
/docs/source/api-reference/python/index.rst:
--------------------------------------------------------------------------------
1 | *******
2 | Python
3 | *******
4 |
5 | .. module:: pybpod_web.basewidget.BaseWidget
6 | :synopsis: entities
7 |
8 | .. toctree::
9 | :titlesonly:
10 |
11 | basewidget
12 | controls
13 | widgets/django
14 |
--------------------------------------------------------------------------------
/docs/source/api-reference/python/widgets/django.rst:
--------------------------------------------------------------------------------
1 | ***************************
2 | :mod:`Django admin`
3 | ***************************
4 |
5 |
6 |
7 | ModelAdminWidget
8 | ----------------------------
9 | .. image:: /_static/imgs/model-admin.png
10 | :width: 500px
11 | :align: center
12 |
13 | .. autoclass:: pyforms_web.widgets.django.modeladmin.ModelAdminWidget
14 | :members:
15 | :undoc-members:
16 | :show-inheritance:
17 |
18 | ModelFormWidget
19 | ----------------------------
20 |
21 | .. image:: /_static/imgs/model-edit.png
22 | :width: 600px
23 | :align: center
24 |
25 | .. autoclass:: pyforms_web.widgets.django.modelform.ModelFormWidget
26 | :members:
27 | :undoc-members:
28 | :show-inheritance:
29 |
30 | |
31 | |
32 |
33 | ----------------------------
34 |
35 | ModelViewFormWidget
36 | ----------------------------
37 |
38 | |
39 |
40 | .. image:: /_static/imgs/model-view.png
41 | :width: 600px
42 | :align: center
43 |
44 | .. autoclass:: pyforms_web.widgets.django.modelviewform.ModelViewFormWidget
45 | :members:
46 | :undoc-members:
47 | :show-inheritance:
48 | :exclude-members: create_model_formfields,create_newobject,save_event,delete_event,get_buttons_row
49 |
50 |
--------------------------------------------------------------------------------
/docs/source/getting-started/advance-db.rst:
--------------------------------------------------------------------------------
1 | ******************************************
2 | From SQL to Django models' apps
3 | ******************************************
4 |
5 | This example demonstrates how to start from a raw database and end up with the forms to manage it in few steps.
6 |
7 | .. note::
8 |
9 | This examples is based on the code available at the folder tutorials/tutorial_advance_db
10 |
11 |
12 |
13 | First of all start your django project:
14 |
15 | .. code:: console
16 |
17 | > django-admin startproject tutorial_advance_db
18 |
19 | Configure your django app settings.py file to point your database and include the pyforms configurations.
20 |
21 | .. code:: python
22 |
23 | ...
24 |
25 | INSTALLED_APPS = [
26 | 'tutorial',
27 |
28 | 'orquestra',
29 | 'pyforms_web.web',
30 | 'jfu',
31 |
32 | 'django.contrib.admin',
33 | 'django.contrib.auth',
34 | 'django.contrib.contenttypes',
35 | 'django.contrib.sessions',
36 | 'django.contrib.messages',
37 | 'django.contrib.staticfiles',
38 | ]
39 |
40 | MIDDLEWARE = [
41 | 'django.middleware.security.SecurityMiddleware',
42 | 'django.contrib.sessions.middleware.SessionMiddleware',
43 | 'django.middleware.common.CommonMiddleware',
44 | 'django.middleware.csrf.CsrfViewMiddleware',
45 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
46 | 'django.contrib.messages.middleware.MessageMiddleware',
47 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
48 | 'pyforms_web.web.middleware.PyFormsMiddleware'
49 | ]
50 | ...
51 |
52 | Enter in the project folder and create the tutorial app:
53 |
54 | .. code:: console
55 |
56 | > cd tutorial_advance_db
57 | > mkdir tutorial
58 |
59 |
60 | Generate the Django models from your SQL database.
61 |
62 | .. code:: console
63 |
64 | > python manage.py inspectdb > tutorial/models.py
65 |
66 | Generate the Pyforms apps to manage the models by executing the next command:
67 |
68 | .. code:: console
69 |
70 | > python manage.py export_pyforms_apps tutorial
71 |
72 | Run migrations and execute the django project:
73 |
74 | .. code:: console
75 |
76 | > python manage.py migrate
77 | > python manage.py runserver
--------------------------------------------------------------------------------
/docs/source/getting-started/apps-permissions.rst:
--------------------------------------------------------------------------------
1 | ******************************************
2 | Apps permissions
3 | ******************************************
4 |
5 | .. note::
6 |
7 | Checkout the :class:`pyforms_web.basewidget.BaseWidget` class for more information.
8 |
9 |
10 | For some web applications there is the need of implementing several users profiles, with different access to functionalities and data.
11 |
12 | On this page we are going to show how the access to Pyforms applications can be restricted.
13 |
14 | AUTHORIZED_GROUPS variable
15 | =====================================
16 |
17 | This BaseWidget variable can be set with the list of Django groups that has access to the app.
18 |
19 | Example:
20 |
21 | .. code:: python
22 |
23 | ...
24 |
25 | class EmployeesAdminApp(ModelAdminWidget):
26 |
27 | ...
28 |
29 | AUTHORIZED_GROUPS = ['superuser', 'django-group']
30 |
31 | ...
32 |
33 | .. note::
34 |
35 | In the case you want to restrict the access to a **superuser** user then instead of using the name of a Django group you should use the label *'superuser'*.
36 |
37 |
38 | Overwrite the BaseWidget functions
39 | ===================================
40 |
41 | The second way of restricting the access to an app is by overwriting the permissions functions from the BaseWidget class.
42 |
43 | .. note::
44 |
45 | By overwriting the permissions' methods of the BaseWidget class your are overwriting the functionality of the **AUTHORIZED_GROUPS** variable.
46 |
47 | Example:
48 |
49 | .. code:: python
50 |
51 | ...
52 |
53 | class EmployeesAdminApp(ModelAdminWidget):
54 |
55 | ...
56 |
57 | @classmethod
58 | def has_permissions(cls, user):
59 | """
60 | This class method, verifies if a user has permissions to execute the application
61 | """
62 | return True or False
63 |
64 | def has_session_permissions(self, user):
65 | """
66 | It verifies if a user has permissions to execute the application during the runtime.
67 | """
68 | return True or False
69 |
70 | ...
--------------------------------------------------------------------------------
/docs/source/local_settings.py:
--------------------------------------------------------------------------------
1 | SETTINGS_PRIORITY = 0
2 | PYFORMS_MODE = 'WEB'
3 |
--------------------------------------------------------------------------------
/docs/source/orquestra/customize.rst:
--------------------------------------------------------------------------------
1 | ********************
2 | Customize the layout
3 | ********************
4 |
--------------------------------------------------------------------------------
/docs/source/orquestra/orquestra-layers.drawio:
--------------------------------------------------------------------------------
1 | xZZdb4IwFEB/DY8mQB3i40Q3s8zsAZc9V3qBboU2tYru169I+Qox2RKmPJBybm9pT28oFgqy07PEIt1wAsxybXKy0NJy3fnU0/cSnCvg2XYFEklJhZwWhPQbDKy7HSiBfa+j4pwpKvow4nkOkeoxLCUv+t1izvpvFTiBAQgjzIb0gxKVVtR3Zy1fA03S+s2ON68iGa47m5XsU0x40UFoZaFAcq6qVnYKgJXuai9V3tOVaDMxCbn6TcLEEQ+Tycv29e39oMRsW0SETswoR8wOZsHr7ea1lAyZYFhp9dXk1bk2IvkhJ1AOaltoUaRUQShwVEYLXQKapSpj+snRzZgyFnDG5SUXRRE8xLHmeyX5F3QiyENzpAddmAmBVHC6ulKn8afrDngGSp51F5Pg+ka5qTlUb0HR7qA7NSzt7F7NsCmapBm69aobRu0fNLsDzctPnCe8ZBSKUR3H+vL9mzv27u0YDRwHYTiu2Xk8K1P/1+zU7pttTHfMOu4tzU4HZl/wEe8jSYUaVTBcrluX7v0F+wPBj0Kfb+UhkusDRo77DSaw83e3ltxU9T98H/Rje4xeYp1/EbT6AQ==
--------------------------------------------------------------------------------
/docs/source/orquestra/orquestra-layout.drawio:
--------------------------------------------------------------------------------
1 | 7Zjfk5owEMf/Gh91CEHQx/NXr9NzvJ52+hwhQOYCoSGc2r++GwgKxZu2MzjXB30hbjbZzX4/SdABnifHT5Jk8VoElA9sKzgO8GJg2wghDA9tOVUWz3IrQyRZYJwuhi37SY3RMtaCBTRvOSohuGJZ2+iLNKW+atmIlOLQdgsFb0fNSEQ7hq1PeNf6nQUqrqwT27vYHymL4joycqdVT0JqZ7OSPCaBODRMeDnAcymEqlrJcU65Ll5dl2rc6p3ec2KSpupvBiRfHtH0hU2DHX/LAq6+bmQyNLO8EV6YBZtk1amuAOSd6SZLylLN3qhUDAr0RPaUP4ucKSZS6N8LpUQCDlx3zIj/GklRpMFccCHLqXBYfhpzPHAW6bFKZGAleVZJGLIjhaxnZciH2mrVFmjHSmkAHvRy7ZUkh1HEVFzsi5xKQEFBTUY+ZGOvQj8mSUY4jCwC+O4LSYch5MXSCL4mJFdUQiMQfg6PMoBuGJd8yFmuRhk445kpFiRPj++qgM7awqagIqFKnsClHjAZOdhqfAxIp5ofQ8vhAps3nY6QCRQ3WHOnxpcYxqNztAsGeokVCf9ABe5QsSP7XGMBSmi1f2ekFFpLVop0iJmi24z4uvcA5wLYYpVACgsEzZBx3oDCsibE0sNyJcXreZc5Z0vtm4pU8xeCvNeYEhCQKV1H1+pLKy1WWx+nq49ba9YUxx7fSBuno83jZr3UkbJMr67ekH1KFEyAU9ynRLgvidyuRN4VifAViVz7VvunBqIh0tNytRvYLle6ZhlJW+K4Pwp9C5R1Gx5MinC2WamQCeEXB2hF1dNKaFrUE0KS1Zx1b4/aoz1B1O5Te8cybluTIXr/0jCT9rKZ25Rgr0MJcpwrG9m91U5G3ct3t3m+Q/KhkHSPkys3suOi0djrsoJvdqDYHVS+bZcvd1Y+kBXXtf4ICsIXnlqgoFuB0n11W39eLJ6Ww/sF9NFni9vCxbmGy9ULyBvd7AbqvkzONrvdZn2n5T+jZTy+JS36J/T5f4iyr/FvDl7+Ag==
--------------------------------------------------------------------------------
/environment.yml:
--------------------------------------------------------------------------------
1 | name: pyforms-web-environment
2 | channels:
3 | - defaults
4 | dependencies:
5 | - python=3.6
6 | - pip:
7 | - sphinx-rtd-theme
8 | - sphinx-js
9 | - recommonmark
10 | - pyforms-web
11 |
--------------------------------------------------------------------------------
/pyforms/__init__.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # -*- coding: utf-8 -*-
3 |
4 | __author__ = "Ricardo Ribeiro"
5 | __credits__ = ["Ricardo Ribeiro"]
6 | __version__ = '4.0.1'
7 | __license__ = 'MIT'
8 | __maintainer__ = ["Ricardo Ribeiro"]
9 | __email__ = ["ricardojvr@gmail.com"]
10 | __status__ = "Production"
11 |
12 |
13 | from confapp import conf
14 |
15 | conf += 'pyforms.settings'
16 |
17 | try:
18 | import local_settings
19 | conf += local_settings
20 | except:
21 | pass
22 |
23 |
24 | try:
25 |
26 | if conf.PYFORMS_MODE == 'GUI':
27 |
28 | from pyforms_gui.appmanager import start_app
29 |
30 | elif conf.PYFORMS_MODE == 'TERMINAL':
31 |
32 | from pyforms_terminal.appmanager import start_app
33 |
34 | except:
35 | pass
--------------------------------------------------------------------------------
/pyforms/basewidget.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 |
3 |
4 | try:
5 |
6 | if conf.PYFORMS_MODE in ['GUI']:
7 |
8 | from pyforms_gui.basewidget import BaseWidget
9 | from pyforms_gui.organizers import vsplitter, hsplitter, segment, no_columns
10 |
11 | elif conf.PYFORMS_MODE in ['TERMINAL']:
12 |
13 | from pyforms_terminal.basewidget import BaseWidget
14 | no_columns = tuple
15 | segment = list
16 |
17 | elif conf.PYFORMS_MODE in ['WEB']:
18 |
19 | from pyforms_web.basewidget import BaseWidget
20 | from pyforms_web.organizers import no_columns, segment
21 |
22 | except:
23 |
24 | from pyforms_web.basewidget import BaseWidget
25 | from pyforms_web.organizers import no_columns, segment
--------------------------------------------------------------------------------
/pyforms/controls.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 |
3 | try:
4 |
5 | if conf.PYFORMS_MODE in ['GUI']:
6 |
7 | from pyforms_gui.allcontrols import *
8 |
9 | elif conf.PYFORMS_MODE in ['TERMINAL']:
10 |
11 | from pyforms_terminal.allcontrols import *
12 |
13 | elif conf.PYFORMS_MODE in ['WEB']:
14 |
15 | from pyforms_web.allcontrols import *
16 |
17 | except:
18 |
19 | from pyforms_web.allcontrols import *
20 |
--------------------------------------------------------------------------------
/pyforms/dialogs.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 |
3 |
4 | if conf.PYFORMS_MODE=='GUI':
5 | from pyforms_gui.dialogs.csv_parser import CsvParserDialog
6 |
7 |
8 | elif conf.PYFORMS_MODE=='TERMINAL':
9 | class CsvParserDialog(object): pass
--------------------------------------------------------------------------------
/pyforms/settings.py:
--------------------------------------------------------------------------------
1 | # !/usr/bin/python3
2 | # -*- coding: utf-8 -*-
3 |
4 |
5 | import logging, os, sys
6 |
7 | if 'terminal_mode' in sys.argv:
8 | PYFORMS_MODE = 'TERMINAL'
9 | else:
10 | PYFORMS_MODE = os.environ.get('PYFORMS_MODE', 'GUI')
11 |
12 | PYFORMS_LOG_FILENAME = 'pyforms.log'
13 | PYFORMS_LOG_HANDLER_FILE_LEVEL = logging.INFO
14 | PYFORMS_LOG_HANDLER_CONSOLE_LEVEL = logging.INFO
--------------------------------------------------------------------------------
/pyforms_web/__init__.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # -*- coding: utf-8 -*-
3 |
4 | __author__ = "Ricardo Ribeiro"
5 | __credits__ = ["Ricardo Ribeiro"]
6 | __license__ = 'GNU GPLv3'
7 | __version__ = "4.2.0"
8 | __maintainer__ = "Ricardo Ribeiro"
9 | __email__ = "ricardojvr@gmail.com"
10 | __status__ = "Development"
11 |
12 |
13 | from confapp import conf;
14 | conf += 'pyforms_web.settings'
15 |
16 | #force the load of the local settings if exists
17 | try:
18 | import local_settings
19 | conf += local_settings
20 | except:
21 | pass
22 |
--------------------------------------------------------------------------------
/pyforms_web/appmanager.py:
--------------------------------------------------------------------------------
1 | def start_app(ClassObject): pass
--------------------------------------------------------------------------------
/pyforms_web/controls/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/controls/__init__.py
--------------------------------------------------------------------------------
/pyforms_web/controls/control_barschart.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | from pyforms_web.controls.control_base import ControlBase
3 | import simplejson
4 |
5 | class ControlBarsChart(ControlBase):
6 |
7 | def __init__(self, *args, **kwargs):
8 | self._legend = []
9 | self.selected_data = None
10 | self.selected_serie = None
11 |
12 | super().__init__(*args, **kwargs)
13 |
14 | self.data_selected_event = kwargs.get('data_selected_event', self.data_selected_event)
15 |
16 | def init_form(self): return "new ControlBarsChart('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
17 |
18 | def remote_data_selected_event(self):
19 | self.data_selected_event(self.selected_serie, self.selected_data)
20 |
21 | def data_selected_event(self, series_index, data):
22 | pass
23 |
24 | """
25 | @property
26 | def value(self):
27 | rows = []
28 | for title, serie in self._value.items():
29 | new_row = []
30 | for value in row:
31 | if value is None: break
32 | if isinstance(value[0], datetime.datetime): value[0] = str(value[0])
33 | if isinstance(value[0], datetime.date): value[0] = str(value[0])
34 | if isinstance(value[0], str): value[0] = str(value[0])
35 | if isinstance(value[1], str): value[1] = str(value[1])
36 | new_row.append(value)
37 | rows.append(new_row)
38 | return rows
39 |
40 | @value.setter
41 | def value(self, value):
42 | ControlBase.value.fset(self, value)
43 | """
44 |
45 | def serialize(self):
46 | data = ControlBase.serialize(self)
47 |
48 | legend, series = [], []
49 | value = self._value if isinstance(self._value, dict) else {}
50 |
51 | for title, serie in value.items():
52 | legend.append(title)
53 | series.append(serie)
54 |
55 |
56 | data.update({
57 | 'legend': legend,
58 | 'value': series
59 | })
60 |
61 | return data
62 |
63 |
64 | def deserialize(self, properties):
65 | self.selected_serie = properties.get('selected_series', None)
66 | self.selected_data = properties.get('selected_data', None)
67 |
68 | ControlBase.deserialize(self, properties)
69 | self.legend = properties[u'legend']
70 | self.value = properties[u'value']
71 |
72 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_boundingslider.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlBoundingSlider(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | self._min = kwargs.get('min', 0)
8 | self._max = kwargs.get('max', 100)
9 | self._horizontal = kwargs.get('horizontal', False)
10 | super(ControlBoundingSlider, self).__init__(*args, **kwargs)
11 |
12 |
13 | def init_form(self):
14 | return u"new ControlBoundingSlider('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
15 |
16 | @property
17 | def min(self): return self._min
18 |
19 | @min.setter
20 | def min(self, value):
21 | if self._min!=value: self.mark_to_update_client()
22 | self._min = value
23 |
24 | @property
25 | def max(self): return self._max
26 |
27 | @max.setter
28 | def max(self, value):
29 | if self._max!=value: self.mark_to_update_client()
30 | self._max = value
31 |
32 | def serialize(self):
33 | data = super(ControlBoundingSlider, self).serialize()
34 | data.update({ 'max': self.max, 'min': self.min })
35 | return data
36 |
37 | def deserialize(self, properties):
38 | super(ControlBoundingSlider, self).deserialize(properties)
39 | self.max = properties['max']
40 | self.min = properties['min']
--------------------------------------------------------------------------------
/pyforms_web/controls/control_breadcrumb.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlBreadcrumb(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | super(ControlBreadcrumb, self).__init__(*args, **kwargs)
8 | self.action_param = None
9 |
10 | def init_form(self):
11 | return "new ControlBreadcrumb('{0}', {1})".format(
12 | self._name, simplejson.dumps(self.serialize())
13 | )
14 |
15 | def pressed(self):
16 | """
17 | This event is called when the button is pressed.
18 | The correspondent js event is defined in the framework.js file
19 | """
20 | if self.action_param is not None:
21 | self.value[self.action_param][1]()
22 |
23 |
24 | def serialize(self):
25 | data = super(ControlBreadcrumb,self).serialize()
26 | value = []
27 | for i, (label, action) in enumerate(self.value):
28 |
29 | v = {'label': label}
30 |
31 | if callable(action):
32 | v['action_param'] = i
33 | else:
34 | v['link'] = action
35 |
36 | value.append(v)
37 |
38 | data.update({'value':value, 'action_param': None})
39 | return data
40 |
41 | def deserialize(self, properties):
42 | self.action_param = properties.get('action_param', None)
43 |
44 |
45 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_button.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlButton(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | if 'css' not in kwargs: kwargs['css']='blue'
8 | self._labeled = kwargs.get('labeled', False)
9 | super(ControlButton, self).__init__(*args, **kwargs)
10 |
11 | def init_form(self): return "new ControlButton('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
12 |
13 | def pressed(self):
14 | """
15 | This event is called when the button is pressed.
16 | The correspondent js event is defined in the framework.js file
17 | """
18 | if not isinstance(self._value, str) and self._value: self._value()
19 |
20 | def serialize(self):
21 | res = super(ControlButton, self).serialize()
22 | res.update({
23 | 'value': self.value if (isinstance(self.value, str) and len(self.value)>0) else None,
24 | 'labeled': self._labeled
25 | })
26 | return res
27 |
28 | def deserialize(self, properties):
29 | self._label = properties.get('label','')
30 | self._help = properties.get('help','')
31 | if properties.get('value',None):
32 | self.value = properties.get('value',None)
33 | self._visible = properties.get('visible',True)
34 |
35 |
36 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_calendar.py:
--------------------------------------------------------------------------------
1 | from datetime import date
2 | from pyforms_web.controls.control_base import ControlBase
3 | import simplejson
4 |
5 | class ControlCalendar(ControlBase):
6 |
7 | def __init__(self, *args, **kwargs):
8 | super(ControlCalendar, self).__init__(*args, **kwargs)
9 |
10 | today = date.today()
11 | self.month = today.month
12 | self.year = today.year
13 |
14 | def init_form(self): return "new ControlCalendar('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
15 |
16 | def serialize(self):
17 | data = super(ControlCalendar, self).serialize()
18 | data.update({ 'month': self.month, 'year': self.year })
19 | return data
20 |
21 | @property
22 | def month(self): return self._month
23 | @month.setter
24 | def month(self, value):
25 | self.mark_to_update_client()
26 | self._month = value
27 |
28 | @property
29 | def year(self): return self._year
30 | @year.setter
31 | def year(self, value):
32 | self.mark_to_update_client()
33 | self._year = value
34 |
35 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_checkbox.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlCheckBox(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | if 'default' not in kwargs: kwargs['default']=False
8 | self.checkbox_type = kwargs.get('checkbox_type', 'toggle')
9 |
10 | super().__init__(*args, **kwargs)
11 |
12 |
13 | def init_form(self):
14 | return "new ControlCheckBox('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
15 |
16 | def serialize(self):
17 | res = super().serialize()
18 | res['checkbox_type'] = self.checkbox_type
19 | return res
20 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_checkboxlist.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 |
5 | class ControlCheckBoxList(ControlBase):
6 |
7 | def __init__(self, *args, **kwargs):
8 | self._headers = kwargs.get('headers',[])
9 | self._select_entire_row = kwargs.get('select_entire_row',True)
10 | self._read_only = kwargs.get('readonly',True)
11 | self._selected_index = kwargs.get('selected_row_index',-1)
12 |
13 | if 'row_double_click_event' in kwargs:
14 | self.row_double_click_event = kwargs['row_double_click_event']
15 | if 'item_selection_changed_event' in kwargs:
16 | self.item_selection_changed_event = kwargs['item_selection_changed_event']
17 |
18 | super(ControlCheckBoxList, self).__init__(*args, **kwargs)
19 |
20 |
21 | def init_form(self):
22 | return "new ControlCheckBoxList('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
23 |
24 | def item_selection_changed_event(self): pass
25 |
26 |
27 | @property
28 | def headers(self): return self._headers
29 |
30 | @headers.setter
31 | def headers(self, value):
32 | self.mark_to_update_client()
33 | self._headers = value
34 |
35 | @property
36 | def rows_count(self):
37 | if not isinstance(self._value, list): return 0
38 | return len(self._value)
39 |
40 |
41 |
42 | @property
43 | def selected_row_index(self): return self._selected_index
44 |
45 | @selected_row_index.setter
46 | def selected_row_index(self, value):
47 | self.mark_to_update_client()
48 | self._selected_index = value
49 |
50 |
51 | @property
52 | def value(self):
53 | """
54 | Sets and gets the values.
55 |
56 | The values should have the
57 | """
58 | return ControlBase.value.fget(self)
59 |
60 | @value.setter
61 | def value(self, value):
62 | self._selected_index = -1
63 | ControlBase.value.fset(self, value)
64 |
65 | def serialize(self):
66 | data = ControlBase.serialize(self)
67 |
68 | data.update({
69 | 'headers': self.headers,
70 | 'selected_index': self._selected_index,
71 | })
72 | return data
73 |
74 | def deserialize(self, properties):
75 | ControlBase.deserialize(self,properties)
76 | self._selected_index = properties['selected_index']
77 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_codemirror.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlCodeMirror(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | """
8 | :param function on_enter_event: Event called when the Enter key is pressed.
9 | """
10 | super().__init__(*args, **kwargs)
11 | self.height = kwargs.get('height', None)
12 | self.width = kwargs.get('width', None)
13 |
14 | def init_form(self):
15 | return """new ControlCodeMirror('{0}', {1})""".format(
16 | self._name,
17 | simplejson.dumps(self.serialize())
18 | )
19 |
20 | def serialize(self):
21 | data = super().serialize()
22 | data.update({
23 | 'height': self.height,
24 | 'width': self.width
25 | })
26 | return data
--------------------------------------------------------------------------------
/pyforms_web/controls/control_date.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | from datetime import date
3 | from pyforms_web.controls.control_base import ControlBase
4 | import simplejson
5 | from django.db.models.fields import NOT_PROVIDED
6 |
7 | from django.utils.dateparse import parse_datetime
8 | from django.utils import timezone
9 |
10 | class ControlDate(ControlBase):
11 |
12 | def init_form(self): return "new ControlDate('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
13 |
14 | @property
15 | def value(self): return ControlBase.value.fget(self)
16 |
17 | @value.setter
18 | def value(self, value):
19 | try:
20 | if isinstance(value, str) and len(value.strip())==0:
21 | value = None
22 |
23 | if value is not None and isinstance(value, str):
24 | try:
25 | value = datetime.datetime.strptime(value, '%Y%m%d')
26 | except:
27 | try:
28 | value = datetime.datetime.strptime(value, '%Y-%m-%d')
29 | except Exception as e:
30 | raise Exception('The value is not a valid date: '+value)
31 | if value and isinstance(value, datetime.datetime):
32 | value = value.date()
33 |
34 |
35 | ControlBase.value.fset(self, value)
36 | self.error = False
37 | except Exception as e:
38 | self.error = True
39 | self.mark_to_update_client()
40 | raise e
41 |
42 | def serialize(self):
43 | data = ControlBase.serialize(self)
44 |
45 | if self.value and self.value != NOT_PROVIDED:
46 | data.update({'value': self.value.isoformat()} )
47 | return data
48 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_datetime.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | from pyforms_web.controls.control_base import ControlBase
3 | import simplejson
4 |
5 | from django.utils.dateparse import parse_datetime
6 | from django.utils import timezone
7 |
8 | class ControlDateTime(ControlBase):
9 |
10 |
11 | def init_form(self): return "new ControlDateTime('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
12 |
13 | @property
14 | def value(self): return ControlBase.value.fget(self)
15 |
16 | @value.setter
17 | def value(self, value):
18 |
19 | # covers usage like `DateTimeField(default=timezone.now)`
20 | value = value() if callable(value) else value
21 |
22 | try:
23 | if isinstance(value, str) and len(value.strip())==0:
24 | value = None
25 |
26 | if value is not None and not isinstance(value, datetime.date):
27 | try:
28 | value = parse_datetime(value)
29 | value = timezone.localtime(value)
30 | except:
31 | raise Exception('The value is not a valid date time')
32 |
33 | ControlBase.value.fset(self, value)
34 | self.error = False
35 | except Exception as e:
36 | self.error = True
37 | self.mark_to_update_client()
38 | raise e
39 |
40 | def serialize(self):
41 | data = ControlBase.serialize(self)
42 |
43 | if self.value:
44 | data.update({'value': self.value.isoformat() })
45 | return data
46 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_decimal.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson, decimal
3 |
4 | class ControlDecimal(ControlBase):
5 |
6 | def init_form(self):
7 | return """new ControlFloat('{0}', {1})""".format(
8 | self._name,
9 | simplejson.dumps(self.serialize())
10 | )
11 |
12 |
13 | def deserialize(self, properties):
14 | """
15 | Serialize the control data.
16 |
17 | :param dict properties: Serialized data to load.
18 | """
19 | str_val = properties.get('value', None)
20 | self.value = decimal.Decimal(str_val) if str_val else None
21 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_dir.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlDir(ControlBase):
5 |
6 | def init_form(self):
7 | return "new ControlDir('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
8 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_email.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_text import ControlText
2 | import simplejson
3 |
4 | class ControlEmail(ControlText):
5 |
6 | def init_form(self):
7 | return """new ControlEmail('{0}', {1})""".format(
8 | self._name,
9 | simplejson.dumps(self.serialize())
10 | )
--------------------------------------------------------------------------------
/pyforms_web/controls/control_emptywidget.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | from pyforms_web.basewidget import BaseWidget
3 | import base64, dill
4 | import simplejson
5 | from pyforms_web.web.middleware import PyFormsMiddleware
6 |
7 | class ControlEmptyWidget(ControlBase):
8 |
9 | def __init__(self, *args, **kwargs):
10 | super(ControlEmptyWidget,self).__init__(*args, **kwargs)
11 | self._parent = kwargs.get('parent', None)
12 | self._name = kwargs.get('name', None)
13 | if 'default' in kwargs:
14 | self.value = kwargs.get('default', None)
15 |
16 | def init_form(self):
17 | return """new ControlEmptyWidget('{0}', {1})""".format(
18 | self._name,
19 | simplejson.dumps(self.serialize())
20 | )
21 |
22 | def serialize(self):
23 | data = ControlBase.serialize(self)
24 |
25 | if isinstance(self.value, BaseWidget):
26 | data.update({
27 | 'value':self.value.uid
28 | })
29 | self.value.parent = self.parent
30 | else:
31 | data.update({'value':None, 'clear_widget': True})
32 |
33 | return data
34 |
35 | def deserialize(self, properties):
36 | #self._label = properties.get('label','')
37 | #self._help = properties.get('help','')
38 | #self._visible = properties.get('visible',True)
39 |
40 | if isinstance(self.value, BaseWidget):
41 | self.value = PyFormsMiddleware.get_instance(self._value.uid)
42 | if self.value is not None:
43 | self.value.parent = self.parent
44 | else:
45 | self.value = None
46 |
47 |
48 |
49 | @property
50 | def value(self):
51 | return ControlBase.value.fget(self)
52 |
53 | @value.setter
54 | def value(self, value):
55 | ControlBase.value.fset(self, value)
56 | if value:
57 | value.LAYOUT_POSITION = self.place_id
58 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_feed.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlFeed(ControlBase):
5 |
6 | EMPTY_MSG = '
'
7 |
8 | def __init__(self, *args, **kwargs):
9 | self._read_only = False
10 | self.has_more = False
11 | self._selected_index = -1
12 | self.item_selection_changed_event = None
13 | self.mode = kwargs.get('mode','feed')
14 |
15 | self.empty_message = kwargs.get('empty_message', self.EMPTY_MSG)
16 |
17 | super(ControlFeed, self).__init__(*args, **kwargs)
18 | self._value = []
19 | self.action_param = None
20 | self._clear = False
21 |
22 |
23 | def init_form(self): return "new ControlFeed('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
24 |
25 | def clear(self):
26 | self._clear = True
27 | self._value = []
28 | self.mark_to_update_client()
29 |
30 | @property
31 | def selected_row_index(self): return self._selected_index
32 |
33 | @selected_row_index.setter
34 | def selected_row_index(self, value):
35 | self.mark_to_update_client()
36 | self._selected_index = value
37 |
38 | def insert_feed(self, pk, html):
39 | self.mark_to_update_client()
40 | data = self.value
41 | data.append({
42 | 'pk':pk,
43 | 'html':html
44 | })
45 | self.value = data
46 |
47 |
48 |
49 | @property
50 | def value(self): return ControlBase.value.fget(self)
51 |
52 | @value.setter
53 | def value(self, value):
54 | self._selected_index = -1
55 | ControlBase.value.fset(self, value)
56 |
57 |
58 | def serialize(self):
59 | res = ControlBase.serialize(self)
60 | res.update({
61 | 'clear':self._clear,
62 | 'has_more': self.has_more,
63 | 'mode': self.mode,
64 | 'empty_message': self.empty_message
65 | })
66 | self._clear = False
67 | self.value = []
68 | return res
69 |
70 |
71 | def deserialize(self, properties):
72 | ControlBase.deserialize(self,properties)
73 | self._value = []
74 | self.action_param = properties.get('action_param', None)
75 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_file.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 |
5 | class ControlFile(ControlBase):
6 |
7 | def init_form(self):
8 | return "new ControlFile('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
9 |
10 | def open_file_browser(self):
11 |
12 | from pyforms_web.web.filesbrowser import FilesBrowserApp
13 | self._win = FilesBrowserApp(file_selected_event=self.__update_filepath)
14 |
15 | def __update_filepath(self, filename):
16 | self.value = filename
17 | self._win.close()
18 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_fileupload.py:
--------------------------------------------------------------------------------
1 | import os
2 | from django.conf import settings
3 | from django.db.models import NOT_PROVIDED
4 | from pyforms_web.controls.control_base import ControlBase
5 | import simplejson
6 |
7 | class ControlFileUpload(ControlBase):
8 |
9 | def init_form(self):
10 | return "new ControlFileUpload('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
11 |
12 | @property
13 | def filepath(self):
14 | if self.value:
15 | return os.path.join( settings.MEDIA_ROOT, self.value[len(settings.MEDIA_URL):] )
16 | else:
17 | return None
18 |
19 | def serialize(self):
20 | data = super(ControlFileUpload, self).serialize()
21 |
22 | if self.value and self.value!=NOT_PROVIDED:
23 | try:
24 | file_data = {
25 | 'name': os.path.basename(self.value),
26 | 'size': os.path.getsize(self.filepath),
27 | 'file': self.value,
28 | 'url': self.value
29 | }
30 | data.update({ 'file_data':file_data })
31 | except OSError:
32 | pass
33 |
34 | return data
--------------------------------------------------------------------------------
/pyforms_web/controls/control_float.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlFloat(ControlBase):
5 |
6 | def init_form(self):
7 | return """new ControlFloat('{0}', {1})""".format(
8 | self._name,
9 | simplejson.dumps(self.serialize())
10 | )
11 |
12 |
13 | def deserialize(self, properties):
14 | """
15 | Serialize the control data.
16 |
17 | :param dict properties: Serialized data to load.
18 | """
19 | super().deserialize(properties)
20 |
21 | self.value = float(
22 | properties.get('value', None)
23 | )
--------------------------------------------------------------------------------
/pyforms_web/controls/control_html.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlHtml(ControlBase):
5 |
6 | def init_form(self):
7 | return """new ControlHtml('{0}', {1})""".format(
8 | self._name,
9 | simplejson.dumps(self.serialize())
10 | )
11 |
12 | def deserialize(self, properties):
13 | self._label = properties.get('label','')
14 | self._help = properties.get('help','')
15 | self._visible = properties.get('visible',True)
--------------------------------------------------------------------------------
/pyforms_web/controls/control_image.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 |
3 | try:
4 | import cv2
5 | except:
6 | print('no cv2 installed')
7 | import base64
8 | import numpy as np
9 | from io import StringIO
10 | from PIL import Image
11 | import simplejson
12 |
13 |
14 | class ControlImage(ControlBase):
15 |
16 |
17 | def __init__(self, *args, **kwargs):
18 | self._filename
19 | super(ControlImage, self).__init__(*args, **kwargs)
20 |
21 |
22 | def init_form(self):
23 | return "new ControlImage('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
24 |
25 | def save(self, data):
26 | if self.value!=None: data['value'] = self._value
27 |
28 | def load(self, data):
29 | if 'value' in data: self.value = data['value']
30 |
31 | def repaint(self): pass
32 |
33 | @property
34 | def value(self): return ControlBase.value.fget(self)
35 |
36 | @value.setter
37 | def value(self, value):
38 | if self._value!=value:
39 | self.mark_to_update_client()
40 | self.changed_event()
41 |
42 | if len(value)==0: self._value = ''
43 | elif isinstance(value, np.ndarray): self._value = value
44 | elif isinstance( value, (str, str) ): self._value = cv2.imread(value)
45 |
46 |
47 | def serialize(self):
48 | data = ControlBase.serialize(self)
49 | image = self.value
50 | if isinstance(image, np.ndarray):
51 | if len(image.shape)>2: image = cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
52 | image = Image.fromarray(image)
53 | buff = StringIO.StringIO()
54 | image.save(buff, format="PNG")
55 | content = buff.getvalue()
56 | buff.close()
57 |
58 | data.update({ 'base64content': base64.b64encode(content) })
59 | data.update({ 'filename': self._filename })
60 | return data
61 |
62 |
63 | def deserialize(self, properties):
64 | ControlBase.deserialize(self, properties)
65 | self._filename = properties['filename']
66 | self.value = self._filename
--------------------------------------------------------------------------------
/pyforms_web/controls/control_img.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlImg(ControlBase):
5 |
6 | def init_form(self):
7 | return """new ControlImg('{0}', {1})""".format(
8 | self._name,
9 | simplejson.dumps(self.serialize())
10 | )
11 |
12 |
13 | def serialize(self):
14 | res = super(ControlImg, self).serialize()
15 | if self.value is None:
16 | res.update({'value':''})
17 | else:
18 | res.update({'value':str(self.value)})
19 | return res
--------------------------------------------------------------------------------
/pyforms_web/controls/control_integer.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlInteger(ControlBase):
5 |
6 | def init_form(self):
7 |
8 | return """new ControlInteger('{0}', {1})""".format(
9 | self._name,
10 | simplejson.dumps(self.serialize())
11 | )
12 |
13 | @property
14 | def value(self): return ControlBase.value.fget(self)
15 |
16 | @value.setter
17 | def value(self, value):
18 | try:
19 |
20 | if value is not None:
21 | if isinstance(value, str) and len(value) == 0:
22 | value = None
23 | else:
24 | try:
25 | value = int(value)
26 | except:
27 | raise Exception('The value is not a number')
28 |
29 | ControlBase.value.fset(self, value)
30 | self.error = False
31 | except Exception as e:
32 | self.error = True
33 | self.mark_to_update_client()
34 | raise e
35 |
36 |
37 | def clean_field(self):
38 | if isinstance(value, str):
39 | raise Exception('The field {0} should be of type integer')
--------------------------------------------------------------------------------
/pyforms_web/controls/control_itemslist.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlItemsList(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | self._read_only = False
8 | self._selected_index = -1
9 | self.item_selection_changed_event = None
10 | self.select_btn_label = 'More '
11 | super(ControlItemsList, self).__init__(*args, **kwargs)
12 |
13 |
14 | def init_form(self): return "new ControlItemsList('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
15 |
16 | def dbl_click(self): pass
17 |
18 |
19 |
20 | @property
21 | def readonly(self): return self._read_only
22 |
23 | @readonly.setter
24 | def readonly(self, value):
25 | self.mark_to_update_client()
26 | self._read_only = value
27 |
28 | @property
29 | def selected_row_index(self): return self._selected_index
30 |
31 | @selected_row_index.setter
32 | def selected_row_index(self, value):
33 | self.mark_to_update_client()
34 | self._selected_index = value
35 |
36 | @property
37 | def value(self): return ControlBase.value.fget(self)
38 |
39 | @value.setter
40 | def value(self, value):
41 | self._selected_index = -1
42 | ControlBase.value.fset(self, value)
43 |
44 | def serialize(self):
45 | data = ControlBase.serialize(self)
46 |
47 | data.update({
48 | 'read_only': 1 if self._read_only else 0,
49 | 'selected_index': self._selected_index
50 | })
51 |
52 | if self.item_selection_changed_event:
53 | data.update({
54 | 'select_btn_label':self.select_btn_label,
55 | })
56 | return data
57 |
58 | def deserialize(self, properties):
59 | ControlBase.deserialize(self,properties)
60 |
61 | self._read_only = properties['read_only']==1
62 | self._selected_index = int(properties['selected_index'])
63 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_label.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlLabel(ControlBase):
5 | def __init__(self, *args, **kwargs):
6 | self._css = ''
7 | super(ControlLabel, self).__init__(*args, **kwargs)
8 |
9 | def init_form(self):
10 | return """new ControlLabel('{0}', {1})""".format(
11 | self._name,
12 | simplejson.dumps(self.serialize())
13 | )
14 |
15 | def deserialize(self, properties): pass
16 |
17 | def serialize(self):
18 | res = super(ControlLabel, self).serialize()
19 | if self.value:
20 | res.update({'value': " ".join(self.value.split("\n"))})
21 | return res
--------------------------------------------------------------------------------
/pyforms_web/controls/control_linechart.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | from pyforms_web.controls.control_base import ControlBase
3 | import simplejson
4 |
5 | class ControlLineChart(ControlBase):
6 |
7 | def __init__(self, *args, **kwargs):
8 | self._legend = []
9 | self.selected_data = None
10 | self.selected_serie = None
11 |
12 | super().__init__(*args, **kwargs)
13 |
14 | self.data_selected_event = kwargs.get('data_selected_event', self.data_selected_event)
15 |
16 | def init_form(self): return "new ControlLineChart('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
17 |
18 | def remote_data_selected_event(self):
19 | self.data_selected_event(self.selected_serie, self.selected_data)
20 |
21 | def data_selected_event(self, series_index, data):
22 | pass
23 |
24 | """
25 | @property
26 | def value(self):
27 | rows = []
28 | for title, serie in self._value.items():
29 | new_row = []
30 | for value in row:
31 | if value is None: break
32 | if isinstance(value[0], datetime.datetime): value[0] = str(value[0])
33 | if isinstance(value[0], datetime.date): value[0] = str(value[0])
34 | if isinstance(value[0], str): value[0] = str(value[0])
35 | if isinstance(value[1], str): value[1] = str(value[1])
36 | new_row.append(value)
37 | rows.append(new_row)
38 | return rows
39 |
40 | @value.setter
41 | def value(self, value):
42 | ControlBase.value.fset(self, value)
43 | """
44 |
45 | def serialize(self):
46 | data = ControlBase.serialize(self)
47 |
48 | legend, series = [], []
49 | value = self._value if isinstance(self._value, dict) else {}
50 |
51 | for title, serie in value.items():
52 | legend.append(title)
53 | series.append(serie)
54 |
55 |
56 | data.update({
57 | 'legend': legend,
58 | 'value': series
59 | })
60 |
61 | return data
62 |
63 |
64 | def deserialize(self, properties):
65 | self.selected_serie = properties.get('selected_series', None)
66 | self.selected_data = properties.get('selected_data', None)
67 |
68 | ControlBase.deserialize(self, properties)
69 | self.legend = properties[u'legend']
70 | self.value = properties[u'value']
71 |
72 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_menu.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 | class ControlMenu(ControlBase):
4 |
5 | def init_form(self):
6 | return """new ControlMenu('{0}', {1})""".format(
7 | self._name,
8 | simplejson.dumps(self.serialize())
9 | )
10 |
11 | def serialize(self):
12 | res = []
13 | for menu_label, menu_list in self.value:
14 | submenu_list = []
15 | for submenu_label, submenu_func in menu_list:
16 | submenu_list.append( [submenu_label, submenu_func.__name__] )
17 | res.append( [menu_label, submenu_list] )
18 |
19 | return {
20 | 'ControlMenu': str(self.__class__.__name__),
21 | 'value': res,
22 | 'label': str(self._label if self._label else ''),
23 | 'help': str(self._help if self._help else ''),
24 | 'visible': int(self._visible)
25 | }
26 |
27 | def deserialize(self, properties):
28 | pass
--------------------------------------------------------------------------------
/pyforms_web/controls/control_multiplechecks.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson, collections
3 |
4 | class ControlMultipleChecks(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | if kwargs.get('default', None) is None: kwargs['default'] = []
8 | super(ControlMultipleChecks, self).__init__(*args, **kwargs)
9 | self.mode = kwargs.get('mode', 'selection')
10 | self._update_items = True
11 | self._items = collections.OrderedDict()
12 |
13 |
14 | def init_form(self): return "new ControlMultipleChecks('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
15 |
16 | def add_item(self, label, value = None):
17 | if self._items==None: self._items={}
18 |
19 | if value==None:
20 | self._items[label] = label
21 | else:
22 | self._items[label] = value
23 |
24 | self._update_items = True
25 | self.mark_to_update_client()
26 |
27 |
28 | def clear_items(self):
29 | self._items = {}
30 | self._value = None
31 | self.mark_to_update_client()
32 |
33 |
34 | def serialize(self):
35 | data = ControlBase.serialize(self)
36 | items = []
37 | for key, value in self._items.items():
38 | items.append({'text': str(key), 'value': value, 'name': str(key)})
39 |
40 | #value = str(self._value) if self._value is not None else None
41 | if isinstance(self._value, list) and len(self._value)>0:
42 | value = list(sorted(self._value))
43 | else:
44 | value = None
45 |
46 |
47 | data.update({ 'items': items, 'value': value, 'mode': self.mode, 'update_items': self._update_items })
48 |
49 | self._update_items = False
50 | return data
51 |
52 |
53 |
54 | def deserialize(self, properties):
55 | properties.update({'value':properties.get('value', [])})
56 |
57 | ControlBase.deserialize(self, properties)
58 |
59 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_multipleselection.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson, collections
3 |
4 | class ControlMultipleSelection(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | if kwargs.get('default', None) is None: kwargs['default'] = []
8 | super(ControlMultipleSelection, self).__init__(*args, **kwargs)
9 | self.mode = kwargs.get('mode', 'selection')
10 | self._update_items = True
11 | self._items = collections.OrderedDict()
12 |
13 |
14 | def init_form(self): return "new ControlMultipleSelection('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
15 |
16 | def add_item(self, label, value = None):
17 | if self._items==None: self._items={}
18 |
19 | if value==None:
20 | self._items[label] = label
21 | else:
22 | self._items[label] = value
23 |
24 | self._update_items = True
25 | self.mark_to_update_client()
26 |
27 |
28 | def clear_items(self):
29 | self._items = {}
30 | self._value = None
31 | self.mark_to_update_client()
32 |
33 |
34 | def serialize(self):
35 | data = ControlBase.serialize(self)
36 | items = []
37 | for key, value in self._items.items():
38 | items.append({'text': str(key), 'value': str(value), 'name': str(key)})
39 |
40 | #value = str(self._value) if self._value is not None else None
41 | if isinstance(self._value, list) and len(self._value)>0:
42 | value = list(map(str,sorted(self._value)))
43 | else:
44 | value = None
45 |
46 |
47 | data.update({ 'items': items, 'value': value, 'mode': self.mode, 'update_items': self._update_items })
48 |
49 | self._update_items = False
50 | return data
51 |
52 |
53 |
54 | def deserialize(self, properties):
55 | value = properties.get('value', [])
56 | values = []
57 | for v in value:
58 | if len(v.strip())>0:
59 | values.append(v)
60 | properties.update({'value':values})
61 |
62 | ControlBase.deserialize(self, properties)
63 |
64 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_multipleupload.py:
--------------------------------------------------------------------------------
1 | import os
2 | from django.conf import settings
3 | from pyforms_web.controls.control_base import ControlBase
4 | import simplejson
5 |
6 | class ControlMultipleUpload(ControlBase):
7 |
8 | def init_form(self):
9 | return "new ControlMultipleUpload('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
10 |
11 | @property
12 | def filepath(self):
13 | return os.path.join( settings.MEDIA_ROOT, self.value[len(settings.MEDIA_URL):] )
14 |
15 | def serialize(self):
16 | data = super().serialize()
17 | if self.value:
18 | try:
19 | file_data = {
20 | 'name': os.path.basename(self.value),
21 | 'size': os.path.getsize(self.filepath),
22 | 'file': self.value,
23 | 'url': self.value
24 | }
25 | data.update({ 'file_data':file_data })
26 | except OSError:
27 | pass
28 |
29 | return data
--------------------------------------------------------------------------------
/pyforms_web/controls/control_organogram.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlOrganogram(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | super().__init__(*args, **kwargs)
8 |
9 | def init_form(self): return "new ControlOrganogram('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
10 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_password.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlPassword(ControlBase):
5 |
6 | def init_form(self):
7 | return """new ControlPassword('{0}', {1})""".format(
8 | self._name,
9 | simplejson.dumps(self.serialize())
10 | )
--------------------------------------------------------------------------------
/pyforms_web/controls/control_piechart.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | from pyforms_web.controls.control_base import ControlBase
3 | import simplejson
4 |
5 | class ControlPieChart(ControlBase):
6 |
7 | def __init__(self, *args, **kwargs):
8 | super(ControlPieChart, self).__init__(*args, **kwargs)
9 |
10 | def init_form(self): return "new ControlPieChart('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
11 |
12 |
13 |
14 |
15 | def deserialize(self, properties):
16 | ControlBase.deserialize(self, properties)
17 | self.legend = properties[u'legend']
18 | self.value = properties[u'value']
19 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_playerjs.py:
--------------------------------------------------------------------------------
1 | try:
2 | import cv2, base64, numpy as np
3 | from PIL import Image
4 | except:
5 | print( "control player will not work. Libraries missing")
6 | from pyforms_web.controls.control_base import ControlBase
7 | import simplejson
8 | from io import BytesIO
9 |
10 | class ControlPlayerJs(ControlBase):
11 |
12 | def __init__(self, *args, **kwargs):
13 | kwargs['css'] = kwargs.get('css', 'fluid')
14 |
15 | self._dataset_url = None
16 |
17 | self.video_fps = kwargs.get('fps', None)
18 | self.video_width = kwargs.get('width', None)
19 | self.video_height = kwargs.get('height', None)
20 | ControlBase.__init__(self, *args, **kwargs)
21 |
22 |
23 | def init_form(self):
24 | return "new ControlPlayerJs('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
25 |
26 | def load_dataset(self, data_url):
27 | self._dataset_url = data_url
28 | self.mark_to_update_client()
29 |
30 |
31 |
32 | def serialize(self):
33 | data = super().serialize()
34 | data.update({
35 | 'video_width': self.video_width,
36 | 'video_height': self.video_height
37 | })
38 | if self._dataset_url:
39 | data.update({ 'data_url': self._dataset_url })
40 | self._dataset_url = None
41 | return data
42 |
43 |
44 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_progress.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlProgress(ControlBase):
5 |
6 | _min = 0
7 | _max = 100
8 |
9 | def __init__(self, *args, **kwargs):
10 | self._updateSlider = True
11 | self._min = kwargs.get('min', 0)
12 | self._max = kwargs.get('max', 100)
13 | ControlBase.__init__(self, *args, **kwargs)
14 |
15 | def init_form(self): return "new ControlProgress('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
16 |
17 |
18 |
19 |
20 | @property
21 | def min(self): return self._min
22 | @min.setter
23 | def min(self, value):
24 | if self._min!=value: self.mark_to_update_client()
25 | self._min = value
26 |
27 | @property
28 | def max(self): return self._max
29 | @max.setter
30 | def max(self, value):
31 | if self._max!=value: self.mark_to_update_client()
32 | self._max = value
33 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_querycards.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_querylist import ControlQueryList
2 | from django.apps import apps
3 | from django.db.models.constants import LOOKUP_SEP
4 | from django.core.exceptions import FieldDoesNotExist
5 | from django.utils.encoding import force_text
6 | import simplejson
7 |
8 |
9 | class ControlQueryCards(ControlQueryList):
10 |
11 |
12 | def init_form(self): return "new ControlQueryCards('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
13 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_search.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlSearch(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | super().__init__(*args, **kwargs)
8 |
9 | def init_form(self):
10 | return """new ControlSearch('{0}', {1})""".format(
11 | self._name,
12 | simplejson.dumps(self.serialize())
13 | )
14 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_simplelabel.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlSimpleLabel(ControlBase):
5 | def __init__(self, *args, **kwargs):
6 | self._css = ''
7 | super().__init__(*args, **kwargs)
8 |
9 | def init_form(self):
10 | return """new ControlSimpleLabel('{0}', {1})""".format(
11 | self._name,
12 | simplejson.dumps(self.serialize())
13 | )
14 |
15 | def deserialize(self, properties): pass
16 |
17 | def serialize(self):
18 | res = super().serialize()
19 | if self.value:
20 | res.update({'value': " ".join(self.value.split("\n"))})
21 | return res
--------------------------------------------------------------------------------
/pyforms_web/controls/control_slider.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlSlider(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | self._updateSlider = True
8 | self._min = kwargs.get('min', 0)
9 | self._max = kwargs.get('max', 100)
10 | if kwargs.get('default', None)==None:
11 | kwargs['default']=0
12 | super(ControlSlider,self).__init__(*args, **kwargs)
13 |
14 | def init_form(self): return "new ControlSlider('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
15 |
16 |
17 | @property
18 | def min(self): return self._min
19 |
20 | @min.setter
21 | def min(self, value):
22 | if self._min!=value:
23 | self.mark_to_update_client()
24 | self._min = value
25 |
26 | @property
27 | def max(self): return self._max
28 |
29 | @max.setter
30 | def max(self, value):
31 | if self._max!=value:
32 | self.mark_to_update_client()
33 | self._max = value
34 |
35 | def deserialize(self, properties):
36 | self.value = int(properties.get('value',None))
37 | self._label = properties.get('label','')
38 | self._help = properties.get('help','')
39 | self._visible = properties.get('visible',True)
40 |
41 | def serialize(self):
42 | data = super(ControlSlider,self).serialize()
43 | data.update({ 'max': self.max, 'min': self.min, 'value': self._value })
44 | return data
--------------------------------------------------------------------------------
/pyforms_web/controls/control_template.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | from django.template.loader import render_to_string
3 | import simplejson, base64
4 |
5 | class ControlTemplate(ControlBase):
6 |
7 |
8 | def __init__(self, *args, **kwargs):
9 | super(ControlTemplate, self).__init__(*args, **kwargs)
10 | self._template = kwargs.get('template', None)
11 | self.action_param = None
12 |
13 | def init_form(self):
14 | return """new ControlTemplate('{0}', {1})""".format(
15 | self._name,
16 | simplejson.dumps(self.serialize())
17 | )
18 |
19 | def serialize(self):
20 | data = super(ControlTemplate,self).serialize()
21 | try:
22 | html = render_to_string(self._template, self.value)
23 | except Exception as e:
24 | html = str(e)
25 |
26 | html = base64.b64encode(html.encode('utf-8'))
27 |
28 | data.update({'value':html})
29 | return data
30 |
31 |
32 | def deserialize(self, properties):
33 | self._label = properties.get('label','')
34 | self._help = properties.get('help','')
35 | self._visible = properties.get('visible',True)
36 | self.action_param = properties.get('action_param', None)
37 |
38 | @property
39 | def template(self):
40 | return self._template
41 | @template.setter
42 | def template(self, value): self._template = value
43 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_text.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class ControlText(ControlBase):
5 |
6 | def __init__(self, *args, **kwargs):
7 | """
8 | :param function on_enter_event: Event called when the Enter key is pressed.
9 | """
10 | super().__init__(*args, **kwargs)
11 | self.on_enter_event = kwargs.get('on_enter_event', self.on_enter_event)
12 |
13 |
14 | def init_form(self):
15 | return """new ControlText('{0}', {1})""".format(
16 | self._name,
17 | simplejson.dumps(self.serialize())
18 | )
19 |
20 | def on_enter_event(self):
21 | """
22 | Event called when the Enter key is pressed
23 | """
24 | pass
25 |
26 | def serialize(self):
27 | res = super(ControlText, self).serialize()
28 | if self.value is None:
29 | res.update({'value':''})
30 | else:
31 | res.update({'value':str(self.value)})
32 | return res
33 |
34 | def deserialize(self, properties):
35 | super(ControlText, self).deserialize(properties)
36 | val = properties.get('value',None)
37 | if val=='': self._value = None
--------------------------------------------------------------------------------
/pyforms_web/controls/control_textarea.py:
--------------------------------------------------------------------------------
1 | from .control_text import ControlText
2 | import simplejson
3 |
4 | class ControlTextArea(ControlText):
5 |
6 | def __init__(self, *args, **kwargs):
7 | """
8 | :param function on_enter_event: Event called when the Enter key is pressed.
9 | """
10 | super().__init__(*args, **kwargs)
11 | self.rows = kwargs.get('rows', 8)
12 | self.cols = kwargs.get('cols', None)
13 |
14 | def init_form(self):
15 | return """new ControlTextArea('{0}', {1})""".format(
16 | self._name,
17 | simplejson.dumps(self.serialize())
18 | )
19 |
20 | def serialize(self):
21 | res = super().serialize()
22 | res.update({'rows':self.rows, 'cols':self.cols})
23 | return res
--------------------------------------------------------------------------------
/pyforms_web/controls/control_timeout.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | from django.utils import timezone
3 | from datetime import datetime, timedelta
4 | import time
5 | import dateutil.parser
6 | import simplejson
7 |
8 | class ControlTimeout(ControlBase):
9 |
10 | def __init__(self, *args, **kwargs):
11 | super(ControlTimeout, self).__init__(*args, **kwargs)
12 | self._last_trigger = timezone.now()
13 | self._play = True
14 | self._update_value = True
15 | self.value = 10000
16 | self._update_interval = 1000
17 |
18 | def init_form(self):
19 | return """new ControlTimeout('{0}', {1})""".format(
20 | self._name,
21 | simplejson.dumps(self.serialize())
22 | )
23 |
24 | def trigger_event(self):
25 | self._last_trigger = timezone.now()
26 | self._update_value = True
27 | self.trigger()
28 |
29 | def trigger(self): pass
30 |
31 | def serialize(self):
32 | data = {
33 | 'name': str(self.__class__.__name__),
34 | 'label': str(self._label if self._label else ''),
35 | 'help': str(self._help if self._help else ''),
36 | 'visible': int(self._visible),
37 | 'play': str(self._play),
38 | 'update_interval': self._update_interval,
39 | 'last_trigger': self._last_trigger.isoformat()
40 | }
41 | if self._update_value: data.update({'value': self.value, 'update_value': str(False) })
42 |
43 | return data
44 |
45 | def deserialize(self, properties):
46 | self.value = int(properties.get('value',None))
47 | self._label = properties.get('label','')
48 | self._help = properties.get('help','')
49 | self._visible = properties.get('visible',True)
50 | self._update_interval = properties.get('update_interval',1000)
51 | self._play = properties.get('play','True')=='True' or properties.get('play','True')==True
52 | self._update_value = properties.get('update_value', 'False')=='True' or properties.get('update_value', 'False')==True
53 |
54 | self._last_trigger = dateutil.parser.parse(properties.get('last_trigger'))
55 |
56 |
57 | @property
58 | def value(self): return ControlBase.value.fget(self)
59 |
60 | @value.setter
61 | def value(self, value):
62 | ControlBase.value.fset(self, value )
63 | self._update_value = True
64 |
65 | def play(self):
66 | self._update_value = True
67 | self._play = True
68 | def stop(self):
69 | self._update_value = True
70 | self._play = False
71 |
72 | def toggle_pause(self):
73 | self._play = not self._play
74 |
--------------------------------------------------------------------------------
/pyforms_web/controls/control_tree.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.controls.control_base import ControlBase
2 | import simplejson
3 |
4 | class TreeNode(object):
5 |
6 | node_id_counter = 0
7 |
8 | def __init__(self, name, parent=None, icon=None):
9 | TreeNode.node_id_counter += 1
10 |
11 | self.childs = []
12 | self.name = name
13 | self.parent = parent
14 | self.icon = icon
15 | self.node_id = str(TreeNode.node_id_counter)
16 |
17 | if parent is not None:
18 | parent.childs.append(self)
19 |
20 | def to_dict(self):
21 | data = {'name': self.name, 'icon': self.icon, 'node_id': self.node_id}
22 | data['childs'] = [child.to_dict() for child in self.childs]
23 | return data
24 |
25 |
26 |
27 | class ControlTree(ControlBase):
28 |
29 | def __init__(self, *args, **kwargs):
30 | self.root = TreeNode('Root')
31 | super().__init__(*args, **kwargs)
32 |
33 | def init_form(self):
34 | return "new ControlTree('{0}', {1})".format( self._name, simplejson.dumps(self.serialize()) )
35 |
36 | def create_child(self, name, parent=None, icon=None):
37 | if parent is None: parent = self.root
38 | return TreeNode(name, parent, icon)
39 |
40 | def find_node_id(self, node_id, node=None):
41 | if node_id is None: return None
42 |
43 | if node.node_id==node_id:
44 | return node
45 | else:
46 | for n in node.childs:
47 | res = self.find_node_id(node_id, n)
48 | if res: return res
49 | return None
50 |
51 |
52 | def serialize(self):
53 | data = super().serialize()
54 | data.update({
55 | 'root': self.root.to_dict(),
56 | 'value': self._value.node_id if self._value else None
57 | })
58 | return data
59 |
60 |
61 | def deserialize(self, properties):
62 | if properties.get('value', None):
63 | properties['value'] = self.find_node_id(
64 | properties.get('value', None),
65 | self.root
66 | )
67 |
68 | super().deserialize(properties)
69 |
--------------------------------------------------------------------------------
/pyforms_web/organizers.py:
--------------------------------------------------------------------------------
1 | class no_columns(object):
2 | def __init__(self, *args, **kwargs):
3 | self.css = kwargs.get('css', '')
4 | self.style = kwargs.get('style', '')
5 | self.items = args
6 | def __getitem__(self,index): return self.items[index]
7 | def __setitem__(self,index,value): self.items[index] = value
8 | def __len__(self): return len(self.items)
9 | def __iter__(self):
10 | self._index = -1; return self
11 | def __next__(self):
12 | self._index += 1
13 | if self._index>=len(self.items): raise StopIteration
14 | return self.items[self._index]
15 |
16 |
17 | class segment(object):
18 | def __init__(self, *args, **kwargs):
19 | self.css = kwargs.get('css', '')
20 | self.field_css = kwargs.get('field_css', '')
21 | self.style = kwargs.get('style', '')
22 | self.field_style = kwargs.get('field_style', '')
23 | self.items = args
24 | def __getitem__(self,index): return self.items[index]
25 | def __setitem__(self,index,value): self.items[index] = value
26 | def __len__(self): return len(self.items)
27 | def __iter__(self):
28 | self._index = -1; return self
29 | def __next__(self):
30 | self._index += 1
31 | if self._index>=len(self.items): raise StopIteration
32 | return self.items[self._index]
33 |
--------------------------------------------------------------------------------
/pyforms_web/settings.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | PYFORMS_WEB_APPS_TIMEOUT = 3600*48
4 |
5 |
6 | PYFORMS_APPS = {}
7 |
8 | LAYOUT_NEW_WINDOW = 2
9 |
10 | PYFORMS_DEBUG = False
11 |
12 | try:
13 | import os
14 | from django.conf import settings
15 |
16 | PYFORMS_WEB_APPS_CACHE_DIR = os.path.join(settings.BASE_DIR,'apps-cache')
17 | PYFORMS_WEB_LOCKFILE = os.path.join(settings.BASE_DIR,'lockfile.txt')
18 | except:
19 | PYFORMS_WEB_APPS_CACHE_DIR = 'apps-cache'
20 | PYFORMS_WEB_LOCKFILE = 'lockfile.txt'
--------------------------------------------------------------------------------
/pyforms_web/web/__init__.py:
--------------------------------------------------------------------------------
1 | from pyforms_web.web.applications import ApplicationsLoader
--------------------------------------------------------------------------------
/pyforms_web/web/fixtures/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/fixtures/__init__.py
--------------------------------------------------------------------------------
/pyforms_web/web/fixtures/conf-allauth-site.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "model": "sites.Site",
4 | "pk": 1,
5 | "fields": {
6 | "domain": "localhost",
7 | "name": "MySite"
8 | }
9 | }
10 | ]
--------------------------------------------------------------------------------
/pyforms_web/web/management/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/management/__init__.py
--------------------------------------------------------------------------------
/pyforms_web/web/management/commands/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/management/commands/__init__.py
--------------------------------------------------------------------------------
/pyforms_web/web/management/pyforms_app_template.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 | from pyforms_web.widgets.django import ModelAdminWidget
3 |
4 | from {application_name}.models import {model_name}
5 |
6 | class {model_name}AdminApp(ModelAdminWidget):
7 |
8 |
9 | UID = '{application_name}-{model_name}-app'.lower()
10 | MODEL = {model_name}
11 |
12 | TITLE = '{model_verbose_name}'
13 |
14 | #list of filters fields
15 | #LIST_FILTER = [{fields_list}]
16 |
17 | #list of fields to display in the table
18 | #LIST_DISPLAY = [{fields_list}]
19 |
20 | #fields to be used in the search
21 | #SEARCH_FIELDS = [{fields_list}]
22 |
23 | #sub models to show in the interface
24 | #INLINES = []
25 |
26 | #formset of the edit form
27 | #FIELDSETS = [{fields_list}]
28 |
29 | #read only fields
30 | #READ_ONLY = [{fields_list}]
31 |
32 | #EDITFORM_CLASS = {model_name}ModelFormWidget #edit form class
33 | #CONTROL_LIST = ControlQueryList #Control to be used in to list the values
34 |
35 | #AUTHORIZED_GROUPS = ['superuser'] #groups with authorization to visualize the app
36 |
37 | ########################################################
38 | #### ORQUESTRA CONFIGURATION ###########################
39 | ########################################################
40 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
41 | ORQUESTRA_MENU = 'left{main_app}'
42 | ORQUESTRA_MENU_ORDER = 0
43 | ORQUESTRA_MENU_ICON = 'dollar'
44 | ########################################################
45 |
46 |
47 |
--------------------------------------------------------------------------------
/pyforms_web/web/middleware/__init__.py:
--------------------------------------------------------------------------------
1 | from .middleware import PyFormsMiddleware
--------------------------------------------------------------------------------
/pyforms_web/web/middleware/apps_2_update.py:
--------------------------------------------------------------------------------
1 |
2 | class Apps2Update(object):
3 |
4 | def __init__(self):
5 | self._top_apps = []
6 | self._bottom_apps = []
7 |
8 | def add_top(self, app):
9 | if app in self._bottom_apps: return
10 | if app in self._top_apps: return
11 |
12 | self._top_apps.append(app)
13 |
14 | def add_bottom(self, app):
15 | if app in self._top_apps: self._top_apps.remove(app)
16 | if app in self._bottom_apps: return
17 |
18 | self._bottom_apps.append(app)
19 |
20 | @property
21 | def applications(self):
22 | #the first apps to be loaded, should be the ones without parent
23 | apps = self._top_apps+self._bottom_apps
24 | apps = sorted(apps, key=lambda x: ('' if (not hasattr(x, '_parent') or x._parent is None) else x._parent) )
25 | return apps
--------------------------------------------------------------------------------
/pyforms_web/web/static/codemirror/autorefresh.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: https://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"))
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod)
9 | else // Plain browser env
10 | mod(CodeMirror)
11 | })(function(CodeMirror) {
12 | "use strict"
13 |
14 | CodeMirror.defineOption("autoRefresh", false, function(cm, val) {
15 | if (cm.state.autoRefresh) {
16 | stopListening(cm, cm.state.autoRefresh)
17 | cm.state.autoRefresh = null
18 | }
19 | if (val && cm.display.wrapper.offsetHeight == 0)
20 | startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250})
21 | })
22 |
23 | function startListening(cm, state) {
24 | function check() {
25 | if (cm.display.wrapper.offsetHeight) {
26 | stopListening(cm, state)
27 | if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight)
28 | cm.refresh()
29 | } else {
30 | state.timeout = setTimeout(check, state.delay)
31 | }
32 | }
33 | state.timeout = setTimeout(check, state.delay)
34 | state.hurry = function() {
35 | clearTimeout(state.timeout)
36 | state.timeout = setTimeout(check, 50)
37 | }
38 | CodeMirror.on(window, "mouseup", state.hurry)
39 | CodeMirror.on(window, "keyup", state.hurry)
40 | }
41 |
42 | function stopListening(_cm, state) {
43 | clearTimeout(state.timeout)
44 | CodeMirror.off(window, "mouseup", state.hurry)
45 | CodeMirror.off(window, "keyup", state.hurry)
46 | }
47 | });
48 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/assets/fonts/jquery.filer-icons/jquery-filer.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/filer/assets/fonts/jquery.filer-icons/jquery-filer.eot
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/assets/fonts/jquery.filer-icons/jquery-filer.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/filer/assets/fonts/jquery.filer-icons/jquery-filer.ttf
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/assets/fonts/jquery.filer-icons/jquery-filer.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/filer/assets/fonts/jquery.filer-icons/jquery-filer.woff
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery.filer",
3 | "version": "1.3.0",
4 | "main": "js/jquery.filer.min.js",
5 | "ignore": [
6 | "**/.*",
7 | "bower_components",
8 | "test"
9 | ],
10 | "homepage": "https://github.com/CreativeDream/jquery.filer",
11 | "authors": [
12 | "CreativeDream "
13 | ],
14 | "description": "Simple HTML5 File Uploader, a plugin tool for jQuery which change completely File Input and make it with multiple file selection, drag&drop support, different validations, thumbnails, icons, instant upload, print-screen upload and many other features and options.",
15 | "license": "MIT",
16 | "dependencies": {
17 | "jquery": ">= 1.7.2"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/examples/default/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Example 1 - jQuery Filer 1.3 - CreativeDream
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
38 |
39 |
40 |
41 |
42 |
Example 1 - jQuery.filer 1.3
43 |
jQuery.filer - Simple HTML5 file uploader, a plugin tool for jQuery which change completely file input and make it with multiple file selection, drag&drop support, different validations, thumbnails, icons, instant upload, print-screen upload and many other features and options.
44 |
Demos | Documentation | Support
45 |
46 |
< Back
47 |
48 |
49 |
50 |
Demo
51 |
52 |
53 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/examples/default/js/custom.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function(){
2 |
3 | $('#filer_input').filer({
4 | showThumbs: true,
5 | addMore: true,
6 | allowDuplicates: false
7 | });
8 |
9 | });
10 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/examples/default/php/form_upload.php:
--------------------------------------------------------------------------------
1 | upload($_FILES['files'], array(
6 | 'limit' => 10, //Maximum Limit of files. {null, Number}
7 | 'maxSize' => 10, //Maximum Size of files {null, Number(in MB's)}
8 | 'extensions' => null, //Whitelist for file extension. {null, Array(ex: array('jpg', 'png'))}
9 | 'required' => false, //Minimum one file is required for upload {Boolean}
10 | 'uploadDir' => '../../../uploads/', //Upload directory {String}
11 | 'title' => array('name'), //New file name {null, String, Array} *please read documentation in README.md
12 | 'removeFiles' => true, //Enable file exclusion {Boolean(extra for jQuery.filer), String($_POST field name containing json data with file names)}
13 | 'replace' => true, //Replace the file if it already exists {Boolean}
14 | 'perms' => null, //Uploaded file permisions {null, Number}
15 | 'onCheck' => null, //A callback function name to be called by checking a file for errors (must return an array) | ($file) | Callback
16 | 'onError' => null, //A callback function name to be called if an error occured (must return an array) | ($errors, $file) | Callback
17 | 'onSuccess' => null, //A callback function name to be called if all files were successfully uploaded | ($files, $metas) | Callback
18 | 'onUpload' => null, //A callback function name to be called if all files were successfully uploaded (must return an array) | ($file) | Callback
19 | 'onComplete' => null, //A callback function name to be called when upload is complete | ($file) | Callback
20 | 'onRemove' => null //A callback function name to be called by removing files (must return an array) | ($removed_files) | Callback
21 | ));
22 |
23 | if($data['isComplete']){
24 | $info = $data['data'];
25 |
26 | echo '';
27 | print_r($info);
28 | echo ' ';
29 | }
30 |
31 | if($data['hasErrors']){
32 | $errors = $data['errors'];
33 | print_r($errors);
34 | }
35 | ?>
36 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/examples/dragdrop/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Example 1 - jQuery Filer 1.3 - CreativeDream
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
43 |
44 |
45 |
46 |
47 |
Example 2 - jQuery.filer 1.3
48 |
jQuery.filer - Simple HTML5 file uploader, a plugin tool for jQuery which change completely file input and make it with multiple file selection, drag&drop support, different validations, thumbnails, icons, instant upload, print-screen upload and many other features and options.
49 |
Demos | Documentation | Support
50 |
51 |
< Back
52 |
53 |
54 |
55 |
Demo
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/examples/dragdrop/php/ajax_remove_file.php:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/examples/dragdrop/php/ajax_upload_file.php:
--------------------------------------------------------------------------------
1 | upload($_FILES['files'], array(
6 | 'limit' => 10, //Maximum Limit of files. {null, Number}
7 | 'maxSize' => 10, //Maximum Size of files {null, Number(in MB's)}
8 | 'extensions' => null, //Whitelist for file extension. {null, Array(ex: array('jpg', 'png'))}
9 | 'required' => false, //Minimum one file is required for upload {Boolean}
10 | 'uploadDir' => '../../../uploads/', //Upload directory {String}
11 | 'title' => array('name'), //New file name {null, String, Array} *please read documentation in README.md
12 | 'removeFiles' => true, //Enable file exclusion {Boolean(extra for jQuery.filer), String($_POST field name containing json data with file names)}
13 | 'replace' => false, //Replace the file if it already exists {Boolean}
14 | 'perms' => null, //Uploaded file permisions {null, Number}
15 | 'onCheck' => null, //A callback function name to be called by checking a file for errors (must return an array) | ($file) | Callback
16 | 'onError' => null, //A callback function name to be called if an error occured (must return an array) | ($errors, $file) | Callback
17 | 'onSuccess' => null, //A callback function name to be called if all files were successfully uploaded | ($files, $metas) | Callback
18 | 'onUpload' => null, //A callback function name to be called if all files were successfully uploaded (must return an array) | ($file) | Callback
19 | 'onComplete' => null, //A callback function name to be called when upload is complete | ($file) | Callback
20 | 'onRemove' => null //A callback function name to be called by removing files (must return an array) | ($removed_files) | Callback
21 | ));
22 |
23 | if($data['isComplete']){
24 | $files = $data['data'];
25 |
26 | echo json_encode($files['metas'][0]['name']);
27 | }
28 |
29 | if($data['hasErrors']){
30 | $errors = $data['errors'];
31 | echo json_encode($errors);
32 | }
33 |
34 | exit;
35 | ?>
36 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | jQuery Filer 1.3 | CreativeDream
7 |
8 |
9 |
10 |
11 |
30 |
31 |
32 |
33 |
34 |
jQuery.filer 1.3
35 |
jQuery.filer - Simple HTML5 file uploader, a plugin tool for jQuery which change completely file input and make it with multiple file selection, drag&drop support, different validations, thumbnails, icons, instant upload, print-screen upload and many other features and options.
36 |
Demos | Documentation | Support
37 |
38 |
39 |
40 |
41 |
42 |
You can also try the examples:
43 |
Example 1 (Default)
44 |
45 |
Example2 (Drag&Drop)
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery.filer",
3 | "version": "1.3.0",
4 | "title": "jQuery.filer - Simple HTML5 file uploader plugin tool for jQuery.",
5 | "description": "jQuery.filer - Simple HTML5 file uploader, a plugin tool for jQuery which change completely file input and make it with multiple file selection, drag&drop support, different validations, thumbnails, icons, instant upload, print-screen upload and many other features and options.",
6 | "keywords": [
7 | "jquery",
8 | "jquery-plugin",
9 | "jquery.filer",
10 | "file",
11 | "upload",
12 | "widget",
13 | "plugin",
14 | "multiple",
15 | "selection",
16 | "drag",
17 | "drop",
18 | "progress",
19 | "preview",
20 | "thumbnails",
21 | "resume",
22 | "php",
23 | "bootstrap"
24 | ],
25 | "homepage": "https://filer.grandesign.md",
26 | "author": {
27 | "name": "CreativeDream",
28 | "url": "https://github.com/CreativeDream/"
29 | },
30 | "maintainers": [
31 | {
32 | "name": "Creative Dream",
33 | "url": "https://github.com/CreativeDream/"
34 | }
35 | ],
36 | "repository": {
37 | "type": "git",
38 | "url": "https://github.com/CreativeDream/jquery.filer.git"
39 | },
40 | "bugs": "https://github.com/CreativeDream/jquery.filer/issues",
41 | "license": "MIT",
42 | "main": "js/jquery.filer.js",
43 | "devDependencies": {
44 | "bower-json": "0.6.0"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/filer/php/readme.txt:
--------------------------------------------------------------------------------
1 | [PHP] Uploader 0.4
2 | https://github.com/CreativeDream/php-uploader
3 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/jqplot/plugins/jqplot.mobile.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jqplot.jquerymobile plugin
3 | * jQuery Mobile virtual event support.
4 | *
5 | * Version: 1.0.9
6 | * Revision: d96a669
7 | *
8 | * Copyright (c) 2011 Takashi Okamoto
9 | * jqPlot is currently available for use in all personal or commercial projects
10 | * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11 | * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12 | * choose the license that best suits your project and use it accordingly.
13 | *
14 | * Although not required, the author would appreciate an email letting him
15 | * know of any substantial use of jqPlot. You can reach the author at:
16 | * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17 | *
18 | * If you are feeling kind and generous, consider supporting the project by
19 | * making a donation at: http://www.jqplot.com/donate.php .
20 | *
21 | */
22 | (function($) {
23 | function postInit(target, data, options){
24 | this.bindCustomEvents = function() {
25 | this.eventCanvas._elem.bind('vclick', {plot:this}, this.onClick);
26 | this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick);
27 | this.eventCanvas._elem.bind('taphold', {plot:this}, this.onDblClick);
28 | this.eventCanvas._elem.bind('vmousedown', {plot:this}, this.onMouseDown);
29 | this.eventCanvas._elem.bind('vmousemove', {plot:this}, this.onMouseMove);
30 | this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter);
31 | this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave);
32 | if (this.captureRightClick) {
33 | this.eventCanvas._elem.bind('vmouseup', {plot:this}, this.onRightClick);
34 | this.eventCanvas._elem.get(0).oncontextmenu = function() {
35 | return false;
36 | };
37 | }
38 | else {
39 | this.eventCanvas._elem.bind('vmouseup', {plot:this}, this.onMouseUp);
40 | }
41 | };
42 | this.plugins.mobile = true;
43 | }
44 | $.jqplot.postInitHooks.push(postInit);
45 | })(jQuery);
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright jQuery Foundation and other contributors, https://jquery.org/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery-ui
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | Copyright and related rights for sample code are waived via CC0. Sample
34 | code is defined as all source code contained within the demos directory.
35 |
36 | CC0: http://creativecommons.org/publicdomain/zero/1.0/
37 |
38 | ====
39 |
40 | All files located in the node_modules and external directories are
41 | externally maintained libraries used by this software which have their
42 | own licenses; we recommend you read them, as their terms may differ from
43 | the terms above.
44 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/images/ui-icons_444444_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/jquery-ui/images/ui-icons_444444_256x240.png
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/images/ui-icons_555555_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/jquery-ui/images/ui-icons_555555_256x240.png
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/images/ui-icons_777620_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/jquery-ui/images/ui-icons_777620_256x240.png
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/images/ui-icons_777777_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/jquery-ui/images/ui-icons_777777_256x240.png
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/images/ui-icons_cc0000_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/jquery-ui/images/ui-icons_cc0000_256x240.png
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/static/jquery-ui/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery-ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-ui",
3 | "title": "jQuery UI",
4 | "description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.",
5 | "version": "1.12.1",
6 | "homepage": "http://jqueryui.com",
7 | "author": {
8 | "name": "jQuery Foundation and other contributors",
9 | "url": "https://github.com/jquery/jquery-ui/blob/1.12.1/AUTHORS.txt"
10 | },
11 | "main": "ui/widget.js",
12 | "maintainers": [
13 | {
14 | "name": "Scott González",
15 | "email": "scott.gonzalez@gmail.com",
16 | "url": "http://scottgonzalez.com"
17 | },
18 | {
19 | "name": "Jörn Zaefferer",
20 | "email": "joern.zaefferer@gmail.com",
21 | "url": "http://bassistance.de"
22 | },
23 | {
24 | "name": "Mike Sherov",
25 | "email": "mike.sherov@gmail.com",
26 | "url": "http://mike.sherov.com"
27 | },
28 | {
29 | "name": "TJ VanToll",
30 | "email": "tj.vantoll@gmail.com",
31 | "url": "http://tjvantoll.com"
32 | },
33 | {
34 | "name": "Felix Nagel",
35 | "email": "info@felixnagel.com",
36 | "url": "http://www.felixnagel.com"
37 | },
38 | {
39 | "name": "Alex Schmitz",
40 | "email": "arschmitz@gmail.com",
41 | "url": "https://github.com/arschmitz"
42 | }
43 | ],
44 | "repository": {
45 | "type": "git",
46 | "url": "git://github.com/jquery/jquery-ui.git"
47 | },
48 | "bugs": "https://bugs.jqueryui.com/",
49 | "license": "MIT",
50 | "scripts": {
51 | "test": "grunt"
52 | },
53 | "dependencies": {},
54 | "devDependencies": {
55 | "commitplease": "2.3.0",
56 | "grunt": "0.4.5",
57 | "grunt-bowercopy": "1.2.4",
58 | "grunt-cli": "0.1.13",
59 | "grunt-compare-size": "0.4.0",
60 | "grunt-contrib-concat": "0.5.1",
61 | "grunt-contrib-csslint": "0.5.0",
62 | "grunt-contrib-jshint": "0.12.0",
63 | "grunt-contrib-qunit": "1.0.1",
64 | "grunt-contrib-requirejs": "0.4.4",
65 | "grunt-contrib-uglify": "0.11.1",
66 | "grunt-git-authors": "3.1.0",
67 | "grunt-html": "6.0.0",
68 | "grunt-jscs": "2.1.0",
69 | "load-grunt-tasks": "3.4.0",
70 | "rimraf": "2.5.1",
71 | "testswarm": "1.1.0"
72 | },
73 | "keywords": []
74 | }
75 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery.flowchart/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright 2016 Sebastien Drouyer
2 | https://github.com/sdrdis/jquery.flowchart
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery.flowchart/flowchart.jquery.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery.flowchart",
3 | "description": "JQuery UI plugin that allows you to draw a flow chart.",
4 | "version": "1.0.0",
5 | "licenses": [
6 | {
7 | "type": "MIT",
8 | "url": "https://github.com/sdrdis/jquery.flowchart/blob/master/MIT-LICENSE.txt"
9 | }
10 | ],
11 | "title": "Flowchart",
12 | "keywords": [
13 | "flowchart",
14 | "flow",
15 | "chart",
16 | "graph",
17 | "ui"
18 | ],
19 | "author": {
20 | "url": "http://sebastien.drouyer.com",
21 | "name": "Sébastien Drouyer"
22 | },
23 | "maintainers": [
24 | {
25 | "name": "Sébastien Drouyer",
26 | "url": "http://sebastien.drouyer.com"
27 | }
28 | ],
29 | "download": "https://github.com/sdrdis/jquery.flowchart/releases",
30 | "homepage": "http://sebastien.drouyer.com/jquery.flowchart-demo/",
31 | "demo": "http://sebastien.drouyer.com/jquery.flowchart-demo/",
32 | "docs": "https://github.com/sdrdis/jquery.flowchart/",
33 | "bugs": "https://github.com/sdrdis/jquery.flowchart/issues",
34 | "dependencies": {
35 | "jquery": ">=1.10",
36 | "jquery-ui": ">=1.11"
37 | }
38 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery.flowchart/jquery.flowchart.min.css:
--------------------------------------------------------------------------------
1 | .flowchart-container{position:relative;overflow:hidden}.flowchart-links-layer,.flowchart-operators-layer,.flowchart-temporary-link-layer{position:absolute;top:0;left:0;width:100%;height:100%}.flowchart-operator-inputs .flowchart-operator-connector-arrow,.flowchart-operator-inputs .flowchart-operator-connector-small-arrow{left:-1px}.flowchart-operators-layer,.flowchart-temporary-link-layer{pointer-events:none}.flowchart-temporary-link-layer{display:none}.flowchart-link,.flowchart-operator{cursor:default}.flowchart-operator-connector{position:relative;padding-top:5px;padding-bottom:5px}.flowchart-operator-connector-label{font-size:small}.flowchart-operator-inputs .flowchart-operator-connector-label{margin-left:14px}.flowchart-operator-outputs .flowchart-operator-connector-label{text-align:right;margin-right:5px}.flowchart-operator-connector-arrow{width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #ccc;position:absolute;top:0}.flowchart-operator-connector-small-arrow{width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid transparent;position:absolute;top:5px;pointer-events:none}.flowchart-operator-connector:hover .flowchart-operator-connector-arrow{border-left:10px solid #999}.flowchart-operator-outputs .flowchart-operator-connector-arrow{right:-10px}.flowchart-operator-outputs .flowchart-operator-connector-small-arrow{right:-7px}.unselectable{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.flowchart-operator{position:absolute;width:140px;border:1px solid #CCC;background:#FAFAFA;pointer-events:initial}.flowchart-operator.hover{border-color:#999}.flowchart-operator.selected{border-color:#555}.flowchart-operator .flowchart-operator-title{width:100%;padding:5px;font-weight:700;box-sizing:border-box;border-bottom:1px solid #DDD;background:#F0F0F0;height:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:move}.flowchart-operator .flowchart-operator-inputs-outputs{display:table;width:100%;margin-top:5px;margin-bottom:5px}.flowchart-default-operator .flowchart-operator-outputs,.flowchart-operator .flowchart-operator-inputs{display:table-cell;width:50%}
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery.flowchart/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery.flowchart",
3 | "description": "JQuery UI plugin that allows you to draw a flow chart.",
4 | "version": "1.1.0",
5 | "licenses": [
6 | {
7 | "type": "MIT",
8 | "url": "https://github.com/sdrdis/jquery.flowchart/blob/master/MIT-LICENSE.txt"
9 | }
10 | ],
11 | "title": "Flowchart",
12 | "keywords": [
13 | "flowchart",
14 | "flow",
15 | "chart",
16 | "graph",
17 | "ui",
18 | "jquery-plugin",
19 | "ecosystem:jquery"
20 | ],
21 | "author": {
22 | "url": "http://sebastien.drouyer.com",
23 | "name": "Sébastien Drouyer"
24 | },
25 | "maintainers": [
26 | {
27 | "name": "Sébastien Drouyer",
28 | "url": "http://sebastien.drouyer.com"
29 | }
30 | ],
31 | "repository": {
32 | "type": "git",
33 | "url": "https://github.com/sdrdis/jquery.flowchart"
34 | },
35 | "homepage": "http://sebastien.drouyer.com/jquery.flowchart-demo/",
36 | "docs": "https://github.com/sdrdis/jquery.flowchart/",
37 | "bugs": "https://github.com/sdrdis/jquery.flowchart/issues",
38 | "dependencies": {
39 | "jquery": ">=1.10",
40 | "jquery-ui": ">=1.11"
41 | }
42 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/jquery.json-2.4.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery JSON plugin 2.4.0 | code.google.com/p/jquery-json */
2 | (function($){'use strict';var escape=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},hasOwn=Object.prototype.hasOwnProperty;$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
3 | var pairs,k,name,val,type=$.type(o);if(type==='undefined'){return undefined;}
4 | if(type==='number'||type==='boolean'){return String(o);}
5 | if(type==='string'){return $.quoteString(o);}
6 | if(typeof o.toJSON==='function'){return $.toJSON(o.toJSON());}
7 | if(type==='date'){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;}
8 | if(day<10){day='0'+day;}
9 | if(hours<10){hours='0'+hours;}
10 | if(minutes<10){minutes='0'+minutes;}
11 | if(seconds<10){seconds='0'+seconds;}
12 | if(milli<100){milli='0'+milli;}
13 | if(milli<10){milli='0'+milli;}
14 | return'"'+year+'-'+month+'-'+day+'T'+
15 | hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
16 | pairs=[];if($.isArray(o)){for(k=0;k";
21 | html += ""+this.properties.label+": "+this.properties.value+" ";
22 | html += "
";
23 | html += "";
24 | this.jquery_place().replaceWith(html);
25 |
26 | var self = this;
27 | this.jquery().slider({
28 | range: true,
29 | slide: function( event, ui ) { $( "#value-"+self.control_id() ).html( ui.value ); },
30 | stop: function(){ self.basewidget.fire_event( self.name, 'update_control_event' )},
31 | min: this.properties.min, max: this.properties.max, values: this.properties.value
32 | });
33 | if(this.properties.required) this.set_required();
34 | };
35 |
36 | ////////////////////////////////////////////////////////////////////////////////
37 |
38 |
39 |
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlBreadcrumb.js:
--------------------------------------------------------------------------------
1 | class ControlBreadcrumb extends ControlBase{
2 |
3 |
4 | ////////////////////////////////////////////////////////////////////////////////
5 |
6 | init_control(){
7 | var html = "";
8 | html += '
';
9 | if(this.properties.value)
10 | for( var i=0; i
'+label+'';
21 | html += ' ';
22 | }
23 | else{
24 | html += ''+label+'
';
25 | }
26 | };
27 | html += ' ';
28 | html += '
';
29 |
30 | this.jquery_place().replaceWith(html);
31 |
32 | var self = this;
33 | this.jquery().find('[action-param]').click(function(){
34 | var action_param = $(this).attr('action-param');
35 | self.properties.action_param = action_param;
36 | self.basewidget.fire_event( self.name, 'pressed' );
37 | });
38 | if(this.properties.required) this.set_required();
39 |
40 | };
41 |
42 | ////////////////////////////////////////////////////////////////////////////////
43 |
44 | get_value(){
45 | return this.properties.value;
46 | };
47 |
48 |
49 | ////////////////////////////////////////////////////////////////////////////////
50 |
51 | update_server(){
52 | return false;
53 | };
54 |
55 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlButton.js:
--------------------------------------------------------------------------------
1 | class ControlButton extends ControlBase{
2 |
3 |
4 | ////////////////////////////////////////////////////////////////////////////////
5 |
6 | init_control(){
7 | var html = "";
8 | if(this.properties.label_visible) html += ' ';
9 | html +=(!this.properties.labeled)?"";
11 | html += this.properties.label;
12 | html +=(!this.properties.labeled)?" ":"
";
13 | html += '';
14 |
15 | this.jquery_place().replaceWith(html);
16 |
17 | var self = this;
18 | this.jquery().click(function(){
19 | if( self.properties.value )
20 | eval(self.properties.value);
21 | else
22 | self.basewidget.fire_event( self.name, 'pressed' );
23 | });
24 | if(this.properties.required) this.set_required();
25 |
26 | };
27 |
28 | ////////////////////////////////////////////////////////////////////////////////
29 |
30 | get_value(){
31 | return this.properties.value;
32 | };
33 |
34 |
35 | ////////////////////////////////////////////////////////////////////////////////
36 |
37 | update_server(){
38 | return false;
39 | };
40 |
41 |
42 | deserialize(data){
43 | $.extend(this.properties, data);
44 | this.set_value(this.properties.value);
45 |
46 | this.jquery().html(this.properties.label);
47 |
48 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
49 | };
50 |
51 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlCalendar.js:
--------------------------------------------------------------------------------
1 | class ControlCalendar extends ControlBase{
2 |
3 |
4 |
5 | init_control(){
6 |
7 | var html = ""+this.properties.label+" ";
8 | html += this.create_calendar();
9 | html += "
";
10 |
11 | this.jquery_place().replaceWith(html);
12 |
13 |
14 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
15 | if(this.properties.required) this.set_required();
16 |
17 | };
18 |
19 | ////////////////////////////////////////////////////////////////////////////////
20 |
21 | create_calendar(){
22 | var date = new Date(this.properties.year, this.properties.month, 0);
23 | var today = new Date();
24 |
25 | var html = "";
26 | for(var n=0; n
";
27 | for(var i=1; i<=date.getDate();i++){
28 | if( date.getYear()==today.getYear() && date.getMonth()==today.getMonth() && i==today.getDate() )
29 | html += ""+i;
30 | else
31 | html += "
"+i;
32 | if( this.properties.value && (i in this.properties.value) ){
33 | html += "";
34 | for(var j=0; j"+this.properties.value[i][j];
36 | html += " ";
37 | };
38 | html += "
";
39 | };
40 | html += "
";
41 | return html;
42 | };
43 |
44 | ////////////////////////////////////////////////////////////////////////////////
45 |
46 |
47 | set_value(value){
48 |
49 | var html = this.create_calendar()
50 | $("#"+this.control_id()).replaceWith(html);
51 |
52 | };
53 |
54 | ////////////////////////////////////////////////////////////////////////////////
55 |
56 | get_value(){
57 | return this.properties.value;
58 | };
59 |
60 |
61 | ////////////////////////////////////////////////////////////////////////////////
62 | }
63 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlCheckBox.js:
--------------------------------------------------------------------------------
1 | class ControlCheckBox extends ControlBase{
2 |
3 | set_value(value){
4 | if(value)
5 | this.jquery().prop('checked', true);
6 | else
7 | this.jquery().prop('checked', false);
8 |
9 | };
10 |
11 | ////////////////////////////////////////////////////////////////////////////////
12 |
13 | get_value(){
14 | if(this.jquery().length==0) return this.properties.value;
15 | return this.jquery().is(':checked');
16 | };
17 |
18 | ////////////////////////////////////////////////////////////////////////////////
19 |
20 | init_control(){
21 | var html = "";
22 | if(this.properties.label_visible)
23 | html += "
";
24 | else
25 | html += "
";
26 | html += `
`;
27 | html += " ";
28 | html += ""+this.properties.label+" ";
29 | html += "
";
30 | this.jquery_place().replaceWith(html);
31 |
32 | if( this.properties.value)
33 | this.jquery().prop('checked', true);
34 | else
35 | this.jquery().prop('checked', false);
36 |
37 |
38 | var self = this;
39 | this.jquery().click(function(){ self.basewidget.fire_event( self.name, 'update_control_event' ); });
40 |
41 | if(!this.properties.visible) this.hide(undefined, true);
42 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
43 | if(this.properties.required) this.set_required();
44 | };
45 |
46 | ////////////////////////////////////////////////////////////////////////////////
47 |
48 |
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlCodeMirror.js:
--------------------------------------------------------------------------------
1 | class ControlCodeMirror extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 | init_control(){
5 | var html = ""
6 | if(this.properties.label_visible) html += ""+this.properties.label+" ";
7 | html += ``;
8 | html += "
";
9 | this.jquery_place().replaceWith(html);
10 |
11 | var mixedMode = {
12 | name: "htmlmixed",
13 | scriptTypes: [
14 | {matches: /\/x-handlebars-template|\/x-mustache/i, mode: null},
15 | {matches: /(text|application)\/(x-)?vb(a|script)/i, mode: "vbscript"}
16 | ]
17 | };
18 | var myTextArea = document.getElementById(this.control_id());
19 | this.codemirror = CodeMirror(
20 | function(elt){ myTextArea.parentNode.replaceChild(elt, myTextArea);},
21 | { mode: mixedMode, autoRefresh: true }
22 | );
23 | var self = this;
24 | this.codemirror.on('blur',function () {
25 | self.basewidget.fire_event( self.name, 'update_control_event' );
26 | })
27 | this.codemirror.setSize(this.properties.width, this.properties.height);
28 | this.set_value(this.properties.value);
29 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
30 | if(this.properties.required) this.set_required();
31 |
32 | };
33 | ////////////////////////////////////////////////////////////////////////////////
34 |
35 | get_value(){
36 | return this.codemirror.getValue();
37 | }
38 |
39 | ////////////////////////////////////////////////////////////////////////////////
40 |
41 | /**
42 | Sets the value of the control.
43 | @param {object} value - Value to set.
44 | */
45 | set_value(value){
46 | this.codemirror.setValue(this.properties.value);
47 | this.codemirror.refresh();
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlCombo.js:
--------------------------------------------------------------------------------
1 | class ControlCombo extends ControlBase{
2 |
3 |
4 |
5 | init_control(){
6 | var html = ""+this.properties.label+" ";
7 | html += "
"
8 | html += '
';
9 | html += '
'+this.properties.placeholder+'
';
10 | html += '
';
11 |
12 | var self = this;
13 | this.jquery_place().replaceWith(html);
14 | this.jquery().dropdown();
15 | this.jquery().dropdown('setup menu', { values: this.properties.items });
16 | this.set_value(this.properties.value);
17 |
18 | this.jquery().dropdown('setting', 'onChange', function(){
19 | if(self.flag_exec_on_change_event)
20 | self.basewidget.fire_event( self.name, 'update_control_event' );
21 | });
22 |
23 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
24 | if(this.properties.required) this.set_required();
25 | };
26 |
27 | ////////////////////////////////////////////////////////////////////////////////
28 |
29 | set_value(value){
30 | this.flag_exec_on_change_event = false;
31 | this.jquery().dropdown('set exactly', [String(value)]);
32 | this.flag_exec_on_change_event = true;
33 | };
34 |
35 | ////////////////////////////////////////////////////////////////////////////////
36 |
37 | get_value(){
38 | var value = this.jquery().dropdown('get value');
39 | if(value=='None') return null;
40 | if(value=='true') return true;
41 | if(value=='false') return false;
42 | if(value=='null') return null;
43 | if(value=='') return ''; // required for Charfield with choices and blank option
44 | return value;
45 | };
46 |
47 | ////////////////////////////////////////////////////////////////////////////////
48 |
49 | deserialize(data){
50 | this.properties = $.extend(this.properties, data);
51 |
52 | this.jquery().dropdown('setup menu', { values: this.properties.items });
53 | this.set_value(this.properties.value);
54 |
55 | if(this.properties.error)
56 | this.jquery_place().addClass('error');
57 | else
58 | this.jquery_place().removeClass('error');
59 | };
60 |
61 | ////////////////////////////////////////////////////////////////////////////////
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlDate.js:
--------------------------------------------------------------------------------
1 | class ControlDate extends ControlBase{
2 |
3 | get_value(){
4 | return this.jquery().datepicker('getDate');
5 | };
6 |
7 | pad(number, size){
8 | var s = String(number);
9 | while (s.length < (size || 2)) {s = "0" + s;}
10 | return s;
11 | }
12 |
13 | formatdate(date){
14 | return date.getFullYear()+'-'+this.pad(date.getMonth()+1,2)+'-'+this.pad(date.getDate(),2);
15 | }
16 |
17 | set_value(value){
18 | if(value!=null)
19 | this.jquery().val(this.formatdate(new Date(value)));
20 | else
21 | this.jquery().val('');
22 | }
23 |
24 | serialize(){
25 | var d = this.get_value();
26 | if(d==null)
27 | this.properties.value = null;
28 | else
29 | this.properties.value = d.getFullYear()+("0"+(d.getMonth()+1)).slice(-2)+ ("0" + d.getDate()).slice(-2);
30 | return this.properties;
31 | }
32 |
33 | ////////////////////////////////////////////////////////////////////////////////
34 |
35 | init_control(){
36 | var html = "
"+this.properties.label+"
";
37 | this.jquery_place().replaceWith(html);
38 | this.set_value(this.properties.value);
39 |
40 | this.jquery().datepicker({
41 | dateFormat: "yy-mm-dd",
42 | changeMonth: true,
43 | changeYear: true,
44 | yearRange: "1900:3000"
45 | });
46 |
47 | this.set_value(this.properties.value);
48 |
49 | var self = this;
50 | this.jquery().change(function(){
51 | self.basewidget.fire_event( self.name, 'update_control_event' );
52 | });
53 |
54 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
55 | if(this.properties.required) this.set_required();
56 | };
57 |
58 | ////////////////////////////////////////////////////////////////////////////////
59 |
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlDateTime.js:
--------------------------------------------------------------------------------
1 | class ControlDateTime extends ControlBase{
2 |
3 | get_value(){
4 | //if(this.jquery().length==0) return this.properties.value;
5 | return this.jquery().datetimepicker('getValue');
6 | }
7 |
8 | pad(number, size){
9 | var s = String(number);
10 | while (s.length < (size || 2)) {s = "0" + s;}
11 | return s;
12 | }
13 |
14 | formatdate(date){
15 | return date.getFullYear()+'-'+this.pad(date.getMonth()+1,2)+'-'+this.pad(date.getDate(),2)+' '+this.pad(date.getHours(),2) + ":" + this.pad(date.getMinutes(),2);
16 | }
17 |
18 | set_value(value){
19 | if(value!=null)
20 | this.jquery().val(this.formatdate(new Date(value)));
21 | else
22 | this.jquery().val('');
23 | }
24 |
25 | ////////////////////////////////////////////////////////////////////////////////
26 |
27 | init_control(){
28 |
29 | var html = "
"+this.properties.label+"
";
30 | this.jquery_place().replaceWith(html);
31 | this.set_value(this.properties.value);
32 |
33 | this.jquery().datetimepicker({
34 | format:'Y-m-d H:i',
35 | formatTime:'H:i',
36 | formatDate:'Y-m-d'
37 | });
38 |
39 | var self = this;
40 |
41 | this.jquery().change(function(){
42 | self.basewidget.fire_event( self.name, 'update_control_event' );
43 | });
44 |
45 |
46 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
47 | if(this.properties.required) this.set_required();
48 | };
49 |
50 | ////////////////////////////////////////////////////////////////////////////////
51 |
52 |
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlDir.js:
--------------------------------------------------------------------------------
1 | class ControlDir extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 |
5 | init_control(){
6 |
7 | var html = "
"+this.properties.label+" ";
8 | html += "
";
9 | html += "
";
10 |
11 | this.jquery_place().replaceWith(html);
12 |
13 | var self = this;
14 | function reload_folder(){
15 | var folder = get_current_folder();
16 | $( "#dialog-content-"+self.control_id()).load(
17 | '/pyforms/filesbrowser/?filter-folders=true&p='+folder+'&control-id='+self.control_id(),
18 | function(){
19 | $( "#dialog"+self.control_id() ).modal('show');
20 | }
21 | );
22 | }
23 |
24 | this.jquery().unbind('click');
25 | this.jquery().click(reload_folder);
26 |
27 |
28 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
29 | if(this.properties.required) this.set_required();
30 | };
31 |
32 | ////////////////////////////////////////////////////////////////////////////////
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlEmail.js:
--------------------------------------------------------------------------------
1 | class ControlEmail extends ControlBase{
2 |
3 |
4 | init_control(){
5 | var html = "
"+this.properties.label+"
";
6 | this.jquery_place().replaceWith(html);
7 |
8 | if(this.properties.value)
9 | this.jquery().val(this.properties.value);
10 | else
11 | this.jquery().val('');
12 |
13 | var self = this;
14 | this.jquery().change(function(){
15 | self.basewidget.fire_event( this.name, 'update_control_event' );
16 | });
17 |
18 |
19 |
20 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
21 | if(this.properties.required) this.set_required();
22 | };
23 |
24 | ////////////////////////////////////////////////////////////////////////////////
25 | }
26 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlEmptyWidget.js:
--------------------------------------------------------------------------------
1 | class ControlEmptyWidget extends ControlBase{
2 |
3 |
4 | ////////////////////////////////////////////////////////////////////////////////
5 |
6 | init_control(){
7 | var widget_html = '';
8 | if( this.properties.html!==undefined ) widget_html = Base64.decode(this.properties.html);
9 |
10 |
11 | var html = "
"+widget_html+"
";
12 | this.jquery_place().replaceWith(html);
13 |
14 | if(this.properties.child_widget_id!==undefined){
15 | var child_app = pyforms.find_app(this.properties.child_widget_id);
16 | child_app.deserialize(this.properties.widget_data);
17 | }
18 |
19 | this.set_value(this.properties.value);
20 |
21 | if(this.properties.required) this.set_required();
22 |
23 | };
24 |
25 | ////////////////////////////////////////////////////////////
26 |
27 | serialize(){
28 | if(this.properties.child_widget_id===undefined) return this.properties;
29 |
30 | var child_app = pyforms.find_app(this.properties.child_widget_id);
31 | this.properties['widget_data'] = child_app.serialize();
32 |
33 | if( child_app.events_queue.length>0 ) this.properties['widget_data']['event'] = child_app.events_queue.pop(0);
34 |
35 | return this.properties;
36 | };
37 |
38 | ////////////////////////////////////////////////////////////////////////////////
39 |
40 | deserialize(data){
41 |
42 | if(data.clear_widget){
43 | pyforms.remove_app( this.properties.child_widget_id );
44 | this.jquery_place().html('');
45 | if( data.child_widget_id===undefined ) delete this.properties.child_widget_id;
46 | delete this.properties.clear_widget;
47 | delete data.clear_widget;
48 | }
49 |
50 | if( data.html!==undefined ){
51 | this.jquery_place().html( Base64.decode(data.html) );
52 | delete data.html;
53 | }
54 |
55 |
56 |
57 | $.extend(this.properties, data);
58 |
59 |
60 | if(this.properties.child_widget_id!==undefined){
61 | var child_app = pyforms.find_app(this.properties.child_widget_id);
62 | child_app.deserialize(this.properties.widget_data);
63 | }
64 |
65 | this.set_value(this.properties.value);
66 |
67 | };
68 |
69 |
70 | update_server(){
71 | return true;
72 | };
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlFile.js:
--------------------------------------------------------------------------------
1 | function add_file2control(control_id, filename){
2 | $( "#dialog"+control_id ).modal('hide');
3 | $( "#"+control_id ).val(filename);
4 |
5 | var ids = pyforms.split_id(control_id);
6 | var widget_id = ids[0];
7 | var control_name = ids[1];
8 |
9 | pyforms.find_app(widget_id).fire_event( control_name, 'update_control_event' )
10 | }
11 |
12 | class ControlFile extends ControlBase{
13 |
14 |
15 |
16 | ////////////////////////////////////////////////////////////////////////////////
17 |
18 | init_control(){
19 | var value = this.properties.value?this.properties.value:'';
20 | var html = "
";
21 | if(this.properties.label_visible) html += ""+this.properties.label+" ";
22 | html += " ";
23 | html += "
";
24 |
25 | this.jquery_place().replaceWith(html);
26 |
27 | /*
28 | var self = this;
29 | function reload_folder(){
30 | var folder = get_current_folder();
31 | $( "#dialog-content-"+self.control_id()).load(
32 | '/pyforms/filesbrowser/?p='+folder+'&control-id='+self.control_id(),
33 | function(){
34 | $( "#dialog"+self.control_id() ).modal('show');
35 | }
36 | );
37 | }
38 | this.jquery().unbind('click');
39 | this.jquery().click(reload_folder);
40 | */
41 | var self = this;
42 | this.jquery().click(function(){
43 | self.basewidget.fire_event( self.name, 'open_file_browser' );
44 | });
45 |
46 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
47 |
48 | if(this.properties.required) this.set_required();
49 | };
50 |
51 |
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlFloat.js:
--------------------------------------------------------------------------------
1 | class ControlFloat extends ControlBase{
2 |
3 |
4 | init_control(){
5 | var html = "
" +
6 | ""+this.properties.label+" " +
7 | "
";
8 | this.jquery_place().replaceWith(html);
9 |
10 | this.set_value(this.properties.value);
11 |
12 | var self = this;
13 | this.jquery().change(function(){
14 | self.basewidget.fire_event( this.name, 'update_control_event' );
15 | });
16 |
17 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
18 |
19 | if(this.properties.required) this.set_required();
20 | };
21 |
22 | ////////////////////////////////////////////////////////////////////////////////
23 |
24 | get_value(){
25 | var value = this.jquery().val();
26 | if(value==undefined || value==null || value=='null' || value.length==0) return null;
27 | else return value;
28 | }
29 |
30 | ////////////////////////////////////////////////////////////////////////////////
31 |
32 | set_value(value){
33 | if(value!=null)
34 | this.jquery().val(value);
35 | else
36 | this.jquery().val('');
37 | }
38 |
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlHtml.js:
--------------------------------------------------------------------------------
1 | class ControlHtml extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 |
5 | init_control(){
6 | var html = '
'
7 | if(this.properties.label_visible) html += '
'+this.properties.label+' ';
8 | html += '
';
9 | html += "
";
10 |
11 | this.jquery_place().replaceWith(html);
12 |
13 | if(this.properties.value)
14 | this.jquery().html(this.properties.value);
15 | else
16 | this.jquery().html('');
17 |
18 | if(this.properties.required) this.set_required();
19 |
20 | };
21 |
22 | ////////////////////////////////////////////////////////////////////////////////
23 |
24 | set_value(value){
25 | if(this.properties.value)
26 | this.jquery().html(this.properties.value);
27 | else
28 | this.jquery().html('');
29 | };
30 |
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlImage.js:
--------------------------------------------------------------------------------
1 | class ControlImage extends ControlBase{
2 |
3 |
4 | ////////////////////////////////////////////////////////////////////////////////
5 |
6 |
7 | get_value(){
8 | return this.jquery().attr('src');
9 | };
10 |
11 | ////////////////////////////////////////////////////////////////////////////////
12 |
13 | set_value(value){
14 | if(value.image) this.jquery().attr("src", "data:image/png;base64,"+value.image);
15 |
16 | var width = this.jquery().width();
17 | this.jquery().css('width', width+"px");
18 |
19 | };
20 |
21 | ////////////////////////////////////////////////////////////////////////////////
22 |
23 | init_control(){
24 | var html = "
";
25 | html += "
";
26 | html += "
";
27 | html += "
";
28 | html += "
";
29 | html += "
";
30 | html += "
";
31 | this.jquery_place().replaceWith(html);
32 | if(this.properties.required) this.set_required();
33 |
34 |
35 | };
36 |
37 | ////////////////////////////////////////////////////////////////////////////////
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlImg.js:
--------------------------------------------------------------------------------
1 | class ControlImg extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 | init_control(){
5 | var html = "
"
6 | if(this.properties.label_visible) html += ""+this.properties.label+" ";
7 | html += "
";
8 | this.jquery_place().replaceWith(html);
9 |
10 | this.set_value(this.properties.value);
11 | if(this.properties.required) this.set_required();
12 | };
13 | ////////////////////////////////////////////////////////////////////////////////
14 |
15 | get_value(){
16 | return this.properties.value;
17 | };
18 |
19 | ////////////////////////////////////////////////////////////////////////////////
20 |
21 | set_value(value){
22 | if(value)
23 | var html = '
';
24 | else
25 | var html = "
";
26 | this.jquery().replaceWith(html);
27 | };
28 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlInteger.js:
--------------------------------------------------------------------------------
1 | class ControlInteger extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 |
5 | init_control(){
6 | var html = `
7 | ${this.properties.label}
8 |
9 |
`;
10 | this.jquery_place().replaceWith(html);
11 | this.set_value(this.properties.value);
12 |
13 | var self = this;
14 | this.jquery().change(function(){
15 | self.basewidget.fire_event( this.name, 'update_control_event' );
16 | });
17 |
18 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
19 | if(this.properties.required) this.set_required();
20 | };
21 |
22 | ////////////////////////////////////////////////////////////////////////////////
23 |
24 |
25 | get_value(){
26 | if(this.jquery().length==0)
27 | return this.properties.value;
28 |
29 | var value = this.jquery().val();
30 |
31 | if(value=='null' || value=='' || value==undefined)
32 | return null;
33 | else
34 | return value;
35 | };
36 |
37 |
38 | ////////////////////////////////////////////////////////////////////////////////
39 |
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlLabel.js:
--------------------------------------------------------------------------------
1 | class ControlLabel extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 |
5 | get_value(){
6 | return this.properties.value;
7 | };
8 |
9 | ////////////////////////////////////////////////////////////////////////////////
10 |
11 | init_control(){
12 | var html = '
';
13 | html += '';
16 | html += '
';
17 | if(this.properties.value!=null || this.properties.value!=undefined)
18 | html += this.properties.value;
19 | html += '
';
20 | html += '
';
21 | this.jquery_place().replaceWith(html);
22 | if(this.properties.required) this.set_required();
23 |
24 |
25 | };
26 |
27 | ////////////////////////////////////////////////////////////////////////////////
28 |
29 | set_value(value){
30 | this.init_control();
31 | };
32 |
33 | ////////////////////////////////////////////////////////////////////////////////
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlMenu.js:
--------------------------------------------------------------------------------
1 | class ControlMenu extends ControlBase{
2 |
3 | get_value(){
4 | return this.properties.value;
5 | };
6 |
7 | ////////////////////////////////////////////////////////////////////////////////
8 |
9 | init_control(){
10 | var html = '';
28 | html += '
';
29 |
30 |
31 | this.jquery_place().replaceWith(html);
32 | this.jquery_place().accordion({exclusive: false});
33 |
34 |
35 | if(this.properties.required) this.set_required();
36 | };
37 |
38 | ////////////////////////////////////////////////////////////////////////////////
39 |
40 | set_value(value){
41 | this.init_control();
42 | };
43 |
44 | ////////////////////////////////////////////////////////////////////////////////
45 |
46 | }
47 |
48 |
49 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlOrganogram.js:
--------------------------------------------------------------------------------
1 | class ControlOrganogram extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 |
5 | init_control(){
6 |
7 | var html = `
8 |
9 |
`;
10 |
11 | this.jquery_place().replaceWith(html);
12 |
13 | var config = [{
14 | container: "#"+this.place_id(),
15 | connectors: { type: 'curve' }
16 | }];
17 |
18 | var x = conf.concat(this.properties.value);
19 | this.graph = new Treant( chart_config );
20 | if(this.properties.required) this.set_required();
21 | };
22 |
23 | ////////////////////////////////////////////////////////////////////////////////
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlPassword.js:
--------------------------------------------------------------------------------
1 | class ControlPassword extends ControlBase{
2 |
3 |
4 |
5 | ////////////////////////////////////////////////////////////////////////////////
6 |
7 | init_control(){
8 | var html = "
"+this.properties.label+"
";
9 | this.jquery_place().replaceWith(html);
10 |
11 | var self = this;
12 | this.jquery().change(function(){
13 | self.basewidget.fire_event( this.name, 'update_control_event' );
14 | });
15 |
16 |
17 |
18 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
19 | if(this.properties.required) this.set_required();
20 | };
21 |
22 | ////////////////////////////////////////////////////////////////////////////////
23 |
24 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlPlayer.js:
--------------------------------------------------------------------------------
1 | class ControlPlayer extends ControlBase{
2 |
3 |
4 | get_value(){
5 | this.properties.video_index = $( "#timeline"+this.control_id()).val();
6 | return this.properties.value;
7 | };
8 |
9 | ////////////////////////////////////////////////////////////////////////////////
10 |
11 | set_value(value){
12 | if(this.properties.base64content){
13 | $("#display"+this.control_id()).attr("src", "data:image/png;base64,"+this.properties.base64content);
14 |
15 | $( "#timeline"+this.control_id()).val(this.properties.video_index);
16 | $( "#timeline"+this.control_id()).attr("min", 0);
17 | $( "#timeline"+this.control_id()).attr("max", this.properties.endFrame);
18 | }
19 | };
20 |
21 | ////////////////////////////////////////////////////////////////////////////////
22 |
23 | init_control(){
24 |
25 | var html = "
";
26 | html += "
";
27 | html += "
";
28 | html += "
";
29 | html += "
";
30 | html += "
";
31 | html += " ";
32 | html += "
";
33 | html += "
";
34 | html += "
";
35 |
36 | this.jquery_place().replaceWith(html);
37 |
38 |
39 | var self = this;
40 | $( "#timeline"+this.control_id() ).change(
41 | function(){ self.basewidget.fire_event( self.name, 'refresh' ); }
42 | );
43 | if(this.properties.required) this.set_required();
44 | };
45 |
46 | ////////////////////////////////////////////////////////////////////////////////
47 |
48 | update_server(){
49 | return this.properties.video_index != $( "#timeline"+this.control_id() ).val()
50 | }
51 |
52 | ////////////////////////////////////////////////////////////////////////////////
53 |
54 | serialize(){
55 | super.serialize();
56 | this.properties.base64content = null;
57 | return this.properties;
58 | }
59 |
60 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlProgress.js:
--------------------------------------------------------------------------------
1 | class ControlProgress extends ControlBase{
2 |
3 | init_control(){
4 | this.jquery_place().replaceWith("
");
5 | if(this.properties.required) this.set_required();
6 | };
7 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlSimpleLabel.js:
--------------------------------------------------------------------------------
1 | class ControlSimpleLabel extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 |
5 | get_value(){
6 | return this.properties.value;
7 | };
8 |
9 | ////////////////////////////////////////////////////////////////////////////////
10 |
11 | init_control(){
12 | var html = '
';
13 | if(this.properties.label){
14 | html += '';
17 | };
18 |
19 | html += '
';
20 | if(this.properties.value!=null || this.properties.value!=undefined)
21 | html += this.properties.value;
22 | html += '
';
23 | html += '
';
24 | this.jquery_place().replaceWith(html);
25 | if(this.properties.required) this.set_required();
26 |
27 |
28 | };
29 |
30 | ////////////////////////////////////////////////////////////////////////////////
31 |
32 | set_value(value){
33 | this.init_control();
34 | };
35 |
36 | ////////////////////////////////////////////////////////////////////////////////
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlSlider.js:
--------------------------------------------------------------------------------
1 | class ControlSlider extends ControlBase{
2 |
3 |
4 | ////////////////////////////////////////////////////////////////////////////////
5 |
6 | get_value(){
7 | return this.jquery().val();
8 | };
9 |
10 | ////////////////////////////////////////////////////////////////////////////////
11 |
12 | set_value(value){
13 | this.jquery().val(value);
14 | $( "#value"+this.name ).html( value );
15 | this.jquery().attr('max', this.properties.max);
16 | this.jquery().attr('min', this.properties.min);
17 | };
18 |
19 | ////////////////////////////////////////////////////////////////////////////////
20 |
21 | init_control(){
22 | var html = "
";
23 | html += "
"+this.properties.label;
24 | html += " "+this.properties.value+"
";
25 | html += " ";
26 | html += "
";
27 | html += "
";
28 |
29 | this.jquery_place().replaceWith(html);
30 | //this.jquery().on('input', function () {$(this).trigger('change');});
31 | var self = this;
32 | this.jquery().change(function(){
33 | $( "#value"+self.control_id() ).html( $(this).val() );
34 | self.basewidget.fire_event( self.name, 'update_control_event' );
35 | });
36 | if(this.properties.required) this.set_required();
37 | };
38 |
39 | ////////////////////////////////////////////////////////////////////////////////
40 |
41 | deserialize(data){
42 | this.properties = $.extend(this.properties, data);
43 | this.set_value(this.properties.value);
44 | };
45 |
46 | ////////////////////////////////////////////////////////////////////////////////
47 |
48 | serialize(){
49 | this.properties.value = this.get_value();
50 | return this.properties;
51 | };
52 |
53 | ////////////////////////////////////////////////////////////////////////////////
54 | }
55 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlTemplate.js:
--------------------------------------------------------------------------------
1 | class ControlTemplate extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 |
5 | init_control(){
6 | var html = "
";
7 | this.jquery_place().replaceWith(html);
8 |
9 | this.set_value(this.properties.value);
10 | if(this.properties.required) this.set_required();
11 | };
12 |
13 | ////////////////////////////////////////////////////////////////////////////////
14 |
15 |
16 | set_value(value){
17 | var html = Base64.decode(value);
18 |
19 | if(html){
20 | this.jquery().html(html);
21 | this.set_actions();
22 | }
23 | else
24 | this.jquery().html('');
25 | };
26 |
27 | ////////////////////////////////////////////////////////////////////////////////
28 |
29 | set_actions(){
30 | this.properties.action_param = undefined;
31 | var self = this;
32 |
33 | this.jquery().find('[action]').click(function(){
34 | var action = $(this).attr('action');
35 | var action_param = $(this).attr('action-param');
36 | self.properties.action_param = action_param;
37 | self.basewidget.fire_event( 'self', action );
38 | });
39 | };
40 |
41 |
42 | update_server(){
43 | return this.properties.action_param != undefined;
44 | };
45 |
46 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlText.js:
--------------------------------------------------------------------------------
1 | class ControlText extends ControlBase{
2 |
3 | ////////////////////////////////////////////////////////////////////////////////
4 | init_control(){
5 | var html = "
"
6 | if(this.properties.label_visible) html += ""+this.properties.label+" ";
7 | html += " ";
8 | html += "
";
9 | this.jquery_place().replaceWith(html);
10 |
11 | this.set_value(this.properties.value);
12 |
13 | var self = this;
14 | this.jquery().change(function(){
15 | self.basewidget.fire_event( this.name, 'update_control_event' );
16 | });
17 |
18 | this.jquery().keypress(function(e) {
19 | if(e.which == 13)
20 | self.basewidget.fire_event( this.name, 'on_enter_event' );
21 | });
22 |
23 | if(this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
24 | if(this.properties.required) this.set_required();
25 | };
26 | ////////////////////////////////////////////////////////////////////////////////
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlTextArea.js:
--------------------------------------------------------------------------------
1 | class ControlTextArea extends ControlBase {
2 |
3 | init_control() {
4 | var html = `
5 | ${this.properties.label}
6 |
9 |
`;
10 | this.jquery_place().replaceWith(html);
11 |
12 | this.set_value(this.properties.value);
13 |
14 | var self = this;
15 | this.jquery().change(function () {
16 | self.basewidget.fire_event(this.name, 'update_control_event');
17 | });
18 |
19 | if (this.properties.error) this.jquery_place().addClass('error'); else this.jquery_place().removeClass('error');
20 | if(this.properties.required) this.set_required();
21 | };
22 |
23 | ////////////////////////////////////////////////////////////////////////////////
24 |
25 | /**
26 | Enable the control.
27 | */
28 | enable(){
29 | this.jquery().removeAttr('readonly');
30 | this.jquery().removeClass('disabled');
31 | }
32 |
33 | ////////////////////////////////////////////////////////////////////////////////
34 |
35 | /**
36 | Disable the control.
37 | */
38 | disable(){
39 | this.jquery().attr('readonly', 'readonly');
40 | this.jquery().addClass('disabled');
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/pyforms_web/web/static/pyformsjs/ControlTimeout.js:
--------------------------------------------------------------------------------
1 | class ControlTimeout extends ControlBase{
2 |
3 | constructor(name, properties){
4 | super(name, properties);
5 | this.timer = undefined;
6 | };
7 |
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | init_control(){
11 | var html = "
"+this.properties.label+" ";
12 | html += "
";
13 | html += '
'
14 | this.jquery_place().replaceWith(html);
15 |
16 |
17 |
18 | this.set_value(this.properties.value);
19 | if (this.properties.play=='True') this.update_progress_bar(true);
20 | if(this.properties.required) this.set_required();
21 | };
22 |
23 | ////////////////////////////////////////////////////////////////////////////////
24 |
25 | update_progress_bar(firsttime){
26 | if(!firsttime) this.jquery().progress('increment',this.properties.update_interval);
27 |
28 | if( parseInt(this.jquery().attr('data-percent'))<100 ){
29 | var self = this;
30 | this.timer = setTimeout(function(){ self.update_progress_bar(false); }, self.properties.update_interval);
31 | }else{
32 | this.basewidget.fire_event( this.name, 'trigger_event' );
33 | }
34 | };
35 |
36 | ////////////////////////////////////////////////////////////////////////////////
37 |
38 | get_value(){
39 | return this.properties.value;
40 | };
41 |
42 | ////////////////////////////////////////////////////////////////////////////////
43 |
44 | set_value(value){
45 | this.jquery().progress({total: value, value:0});
46 | };
47 |
48 | ////////////////////////////////////////////////////////////////////////////////
49 |
50 | deserialize(data){
51 | data.play = 'True'==data.play
52 | last_play_value = this.properties.play
53 | $.extend(this.properties, data);
54 |
55 | if(this.properties.play==false || data.value !== undefined)
56 | if(this.timer!=undefined){
57 | clearTimeout(this.timer);
58 | this.timer=undefined;
59 | }
60 |
61 | if (data.value !== undefined){
62 | this.set_value(this.properties.value);
63 | if (this.properties.play) this.update_progress_bar(false);
64 | }
65 |
66 | if (last_play_value==false && this.properties.play)
67 | this.update_progress_bar(false);
68 |
69 | };
70 |
71 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/timeline/event.js:
--------------------------------------------------------------------------------
1 | class TimelineEvent{
2 |
3 | constructor(title, begin, end, color, track){
4 | this.title = title;
5 | this.begin = begin;
6 | this.end = end;
7 | this.color = color?color:track.color;
8 | this.track = track;
9 |
10 | this.ctx = track.timeline.ctx;
11 | this.timeline = track.timeline;
12 | }
13 |
14 | draw(){
15 | var x = this.timeline.frame2x(this.begin);
16 | var xx = (this.end-this.begin)*this.timeline.zoom;
17 |
18 | this.ctx.globalAlpha = 0.6;
19 | this.ctx.fillStyle = this.color;
20 | this.ctx.fillRect(x, this.track.start_y+2, xx, this.track.timeline.options.y_step-3);
21 | this.ctx.globalAlpha = 1;
22 |
23 | this.ctx.fillStyle = '#333';
24 | this.ctx.fillText(this.title, x+2, this.track.start_y+this.track.timeline.options.y_step/2);
25 | }
26 | }
--------------------------------------------------------------------------------
/pyforms_web/web/static/timeline/graph.js:
--------------------------------------------------------------------------------
1 | var TIMELINEGRAPH_COLORS = ['#DC143C',' #6495ED','#008B8B','#7FFF00', '#E9967A','#2F4F4F', '#9400D3', '#FFD700', '#FFB6C1', '#BA55D3','#9ACD32' ];
2 |
3 | class TimelineGraph{
4 |
5 | constructor(title, data, color, timeline){
6 |
7 | this.title = title;
8 | this.color = color?color:TIMELINEGRAPH_COLORS.shift();
9 | this.timeline = timeline;
10 | this.data = data?data:[];
11 |
12 | this.zoom = 1.0;
13 | this.top = 0;
14 | this.min = Math.min(...this.data);
15 | this.max = Math.max(...this.data);
16 |
17 | this.ctx = timeline.ctx;
18 | }
19 |
20 | draw(){
21 | var begin = this.timeline.offset | 0;
22 | var end = (this.timeline.offset+this.timeline.width) | 0;
23 |
24 | if( begin>=this.data.length ) return;
25 |
26 | var top_margin = this.timeline.options.top_margin;
27 | //calculate the height visible
28 | var fov_height = (this.timeline.height - top_margin) * this.zoom;
29 | //check if the end frame his higher than the available data
30 | end = end>this.data.length?this.data.length:end;
31 | //calculate the difference bettween the lower and higher value
32 | var diff_max_min = this.max - this.min;
33 | if(diff_max_min<=0) diff_max_min = 1
34 |
35 | this.ctx.beginPath();
36 | this.ctx.strokeStyle = this.color;
37 |
38 | var y = this.data[begin];
39 | y = this.timeline.height - (y*fov_height)/diff_max_min;
40 | this.ctx.moveTo(0,y);
41 |
42 | for(var x=begin; x
this.events[idx].begin )
29 | idx++;
30 | this.events.splice(idx, 0, evt);
31 | break;
32 | }
33 |
34 | if( begin .node,
5 | .Treant > .pseudo { position: absolute; display: block; visibility: hidden; }
6 | .Treant.Treant-loaded .node,
7 | .Treant.Treant-loaded .pseudo { visibility: visible; }
8 | .Treant > .pseudo { width: 0; height: 0; border: none; padding: 0; }
9 | .Treant .collapse-switch { width: 3px; height: 3px; display: block; border: 1px solid black; position: absolute; top: 1px; right: 1px; cursor: pointer; }
10 | .Treant .collapsed .collapse-switch { background-color: #868DEE; }
11 | .Treant > .node img { border: none; float: left; }
--------------------------------------------------------------------------------
/pyforms_web/web/templates/pyforms-dependencies.html:
--------------------------------------------------------------------------------
1 | {% for file_url in cssfiles %}
2 | {% endfor %}
3 | {% for file_url in jsfiles %}
4 | {% endfor %}
--------------------------------------------------------------------------------
/pyforms_web/web/templatetags/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/web/templatetags/__init__.py
--------------------------------------------------------------------------------
/pyforms_web/web/urls.py:
--------------------------------------------------------------------------------
1 | from django.conf.urls import url
2 | from pyforms_web.web.views import update_app, remove_app
3 | from pyforms_web.web.views import register_app, open_app, upload_files
4 | from pyforms_web.web.views import autocomplete_search
5 | from pyforms_web.web.views import controllist_queryset_export_csv
6 |
7 |
8 | urlpatterns = [
9 | url(r'^app/register/(?P[a-zA-Z._\- 0-9]+)/', register_app ),
10 | url(r'^app/open/(?P[a-zA-Z._\- 0-9]+)/', open_app ),
11 | url(r'^app/update/(?P[a-zA-Z._\- 0-9]+)/', update_app ),
12 | url(r'^app/remove/(?P[a-zA-Z._\- 0-9]+)/', remove_app ),
13 | url(r'^export-csv/(?P[a-zA-Z._\- 0-9]+)/(?P[a-zA-Z._\- 0-9]+)/', controllist_queryset_export_csv ),
14 | url(r'^autocomplete/(?P[a-zA-Z._\- 0-9]+)/(?P[a-zA-Z._\- 0-9]+)/(?P[a-zA-Z._\- 0-9]+)/', autocomplete_search ),
15 | url(r'^autocomplete/(?P[a-zA-Z._\- 0-9]+)/(?P[a-zA-Z._\- 0-9]+)/', autocomplete_search ),
16 | url(r'^upload-files/', upload_files ),
17 | ]
--------------------------------------------------------------------------------
/pyforms_web/widgets/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/pyforms_web/widgets/__init__.py
--------------------------------------------------------------------------------
/pyforms_web/widgets/django/__init__.py:
--------------------------------------------------------------------------------
1 | from .modeladmin import ModelAdminWidget
2 | from .modelform import ModelFormWidget
3 | from .modelviewform import ModelViewFormWidget
--------------------------------------------------------------------------------
/pyforms_web/widgets/django/utils.py:
--------------------------------------------------------------------------------
1 | import collections
2 |
3 | def get_fieldsets_strings(l):
4 | #lookup on all the structer of the fieldsets for the strings on it
5 | if not isinstance(l, collections.Iterable): return []
6 | res = []
7 | for e in l:
8 | if isinstance(e, str): res.append(e)
9 | elif isinstance(e, dict):
10 | for key, item in e.items():
11 | res += get_fieldsets_strings(item)
12 | else:
13 | res += get_fieldsets_strings(e)
14 | return res
15 |
--------------------------------------------------------------------------------
/readthedocs.yml:
--------------------------------------------------------------------------------
1 | # .readthedocs.yml
2 |
3 | build:
4 | image: latest
5 |
6 | python:
7 | version: 3.6
8 |
9 | formats:
10 | - epub
11 | - pdf
12 |
13 | conda:
14 | file: environment.yml
15 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/a3da156a8-0837-4538-ac9b-8b21542085e3.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/a3da156a8-0837-4538-ac9b-8b21542085e3.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/a52acb200-4a59-44d0-8191-8af0b42cc08e.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/a52acb200-4a59-44d0-8191-8af0b42cc08e.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/a5410d357-c910-41e8-931f-317b5c13dffa.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/a5410d357-c910-41e8-931f-317b5c13dffa.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/a55274747-4a12-4ecc-b436-29f03107c29a.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/a55274747-4a12-4ecc-b436-29f03107c29a.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/ab4682e34-c3fe-4b0c-a345-95fee1dcee19.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/ab4682e34-c3fe-4b0c-a345-95fee1dcee19.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-departments-app.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-departments-app.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-deptemp-app.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-deptemp-app.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-deptmanager-app.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-deptmanager-app.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-employees-app.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-employees-app.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-titles-app.app:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/apps-cache/None-/tutorial-titles-app.app
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/lockfile.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/lockfile.txt
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tutorial_advance_db.settings')
9 | try:
10 | from django.core.management import execute_from_command_line
11 | except ImportError as exc:
12 | raise ImportError(
13 | "Couldn't import Django. Are you sure it's installed and "
14 | "available on your PYTHONPATH environment variable? Did you "
15 | "forget to activate a virtual environment?"
16 | ) from exc
17 | execute_from_command_line(sys.argv)
18 |
19 |
20 | if __name__ == '__main__':
21 | main()
22 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_advance_db/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/tutorial_advance_db/__init__.py
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_advance_db/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for tutorial_advance_db project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tutorial_advance_db.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_advance_db/urls.py:
--------------------------------------------------------------------------------
1 | """tutorial_advance_db URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.conf import settings
17 | from django.contrib import admin
18 | from django.urls import include, path
19 |
20 | urlpatterns = [
21 | path('pyforms/', include('pyforms_web.web.urls') ),
22 | path('', include('orquestra.urls') ),
23 | ]
24 |
25 | if settings.DEBUG:
26 | from django.conf.urls.static import static
27 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_advance_db/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for tutorial_advance_db project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tutorial_advance_db.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_advance_db/tutorial_apps/__init__.py
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/apps/__init__.py:
--------------------------------------------------------------------------------
1 | from .departments_app import DepartmentsAdminApp
2 | from .deptemp_app import DeptEmpAdminApp
3 | from .deptmanager_app import DeptManagerAdminApp
4 | from .employees_app import EmployeesAdminApp
5 | from .salaries_app import SalariesAdminApp
6 | from .titles_app import TitlesAdminApp
7 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/apps/departments_app.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 | from pyforms_web.widgets.django import ModelAdminWidget
3 |
4 | from tutorial.models import Departments
5 |
6 | class DepartmentsAdminApp(ModelAdminWidget):
7 |
8 |
9 | UID = 'tutorial-Departments-app'.lower()
10 | MODEL = Departments
11 |
12 | TITLE = 'Departmentss'
13 |
14 | #list of filters fields
15 | #LIST_FILTER = ['deptemp','deptmanager','dept_no','dept_name']
16 |
17 | #list of fields to display in the table
18 | #LIST_DISPLAY = ['deptemp','deptmanager','dept_no','dept_name']
19 |
20 | #fields to be used in the search
21 | #SEARCH_FIELDS = ['deptemp','deptmanager','dept_no','dept_name']
22 |
23 | #sub models to show in the interface
24 | #INLINES = []
25 |
26 | #formset of the edit form
27 | FIELDSETS = [('deptemp','deptmanager'),'dept_no','dept_name']
28 |
29 | #read only fields
30 | #READ_ONLY = ['deptemp','deptmanager','dept_no','dept_name']
31 |
32 | #EDITFORM_CLASS = DepartmentsModelFormWidget #edit form class
33 | #CONTROL_LIST = ControlQueryList #Control to be used in to list the values
34 |
35 | #AUTHORIZED_GROUPS = ['superuser'] #groups with authorization to visualize the app
36 |
37 | ########################################################
38 | #### ORQUESTRA CONFIGURATION ###########################
39 | ########################################################
40 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
41 | ORQUESTRA_MENU = 'left'
42 | ORQUESTRA_MENU_ORDER = 0
43 | ORQUESTRA_MENU_ICON = 'dollar'
44 | ########################################################
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/apps/deptemp_app.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 | from pyforms_web.widgets.django import ModelAdminWidget
3 |
4 | from tutorial.models import DeptEmp
5 |
6 | class DeptEmpAdminApp(ModelAdminWidget):
7 |
8 |
9 | UID = 'tutorial-DeptEmp-app'.lower()
10 | MODEL = DeptEmp
11 |
12 | TITLE = 'Dept Emps'
13 |
14 | #list of filters fields
15 | #LIST_FILTER = ['emp_no','dept_no','from_date','to_date']
16 |
17 | #list of fields to display in the table
18 | #LIST_DISPLAY = ['emp_no','dept_no','from_date','to_date']
19 |
20 | #fields to be used in the search
21 | #SEARCH_FIELDS = ['emp_no','dept_no','from_date','to_date']
22 |
23 | #sub models to show in the interface
24 | #INLINES = []
25 |
26 | #formset of the edit form
27 | #FIELDSETS = ['emp_no','dept_no','from_date','to_date']
28 |
29 | #read only fields
30 | #READ_ONLY = ['emp_no','dept_no','from_date','to_date']
31 |
32 | #EDITFORM_CLASS = DeptEmpModelFormWidget #edit form class
33 | #CONTROL_LIST = ControlQueryList #Control to be used in to list the values
34 |
35 | #AUTHORIZED_GROUPS = ['superuser'] #groups with authorization to visualize the app
36 |
37 | ########################################################
38 | #### ORQUESTRA CONFIGURATION ###########################
39 | ########################################################
40 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
41 | ORQUESTRA_MENU = 'left>DepartmentsAdminApp'
42 | ORQUESTRA_MENU_ORDER = 0
43 | ORQUESTRA_MENU_ICON = 'dollar'
44 | ########################################################
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/apps/deptmanager_app.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 | from pyforms_web.widgets.django import ModelAdminWidget
3 |
4 | from tutorial.models import DeptManager
5 |
6 | class DeptManagerAdminApp(ModelAdminWidget):
7 |
8 |
9 | UID = 'tutorial-DeptManager-app'.lower()
10 | MODEL = DeptManager
11 |
12 | TITLE = 'Dept Managers'
13 |
14 | #list of filters fields
15 | LIST_FILTER = ['from_date','to_date']
16 |
17 | #list of fields to display in the table
18 | LIST_DISPLAY = ['emp_no','dept_no','from_date','to_date']
19 |
20 | #fields to be used in the search
21 | SEARCH_FIELDS = ['emp_no','dept_no','from_date','to_date']
22 |
23 | #sub models to show in the interface
24 | #INLINES = []
25 |
26 | #formset of the edit form
27 | FIELDSETS = [('emp_no','dept_no'),'from_date','to_date']
28 |
29 | #read only fields
30 | #READ_ONLY = ['emp_no','dept_no','from_date','to_date']
31 |
32 | #EDITFORM_CLASS = DeptManagerModelFormWidget #edit form class
33 | #CONTROL_LIST = ControlQueryList #Control to be used in to list the values
34 |
35 | #AUTHORIZED_GROUPS = ['superuser'] #groups with authorization to visualize the app
36 |
37 | ########################################################
38 | #### ORQUESTRA CONFIGURATION ###########################
39 | ########################################################
40 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
41 | ORQUESTRA_MENU = 'left>DepartmentsAdminApp'
42 | ORQUESTRA_MENU_ORDER = 0
43 | ORQUESTRA_MENU_ICON = 'dollar'
44 | ########################################################
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/apps/employees_app.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 | from pyforms_web.widgets.django import ModelAdminWidget
3 |
4 | from tutorial.models import Employees
5 |
6 | class EmployeesAdminApp(ModelAdminWidget):
7 |
8 |
9 | UID = 'tutorial-Employees-app'.lower()
10 | MODEL = Employees
11 |
12 | TITLE = 'Employeess'
13 |
14 | #list of filters fields
15 | #LIST_FILTER = ['deptemp','deptmanager','salaries','titles','emp_no','birth_date','first_name','last_name','gender','hire_date']
16 |
17 | #list of fields to display in the table
18 | #LIST_DISPLAY = ['deptemp','deptmanager','salaries','titles','emp_no','birth_date','first_name','last_name','gender','hire_date']
19 |
20 | #fields to be used in the search
21 | #SEARCH_FIELDS = ['deptemp','deptmanager','salaries','titles','emp_no','birth_date','first_name','last_name','gender','hire_date']
22 |
23 | #sub models to show in the interface
24 | #INLINES = []
25 |
26 | #formset of the edit form
27 | #FIELDSETS = ['deptemp','deptmanager','salaries','titles','emp_no','birth_date','first_name','last_name','gender','hire_date']
28 |
29 | #read only fields
30 | #READ_ONLY = ['deptemp','deptmanager','salaries','titles','emp_no','birth_date','first_name','last_name','gender','hire_date']
31 |
32 | #EDITFORM_CLASS = EmployeesModelFormWidget #edit form class
33 | #CONTROL_LIST = ControlQueryList #Control to be used in to list the values
34 |
35 | #AUTHORIZED_GROUPS = ['superuser'] #groups with authorization to visualize the app
36 |
37 | ########################################################
38 | #### ORQUESTRA CONFIGURATION ###########################
39 | ########################################################
40 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
41 | ORQUESTRA_MENU = 'left>DepartmentsAdminApp'
42 | ORQUESTRA_MENU_ORDER = 0
43 | ORQUESTRA_MENU_ICON = 'dollar'
44 | ########################################################
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/apps/salaries_app.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 | from pyforms_web.widgets.django import ModelAdminWidget
3 |
4 | from tutorial.models import Salaries
5 |
6 | class SalariesAdminApp(ModelAdminWidget):
7 |
8 |
9 | UID = 'tutorial-Salaries-app'.lower()
10 | MODEL = Salaries
11 |
12 | TITLE = 'Salariess'
13 |
14 | #list of filters fields
15 | #LIST_FILTER = ['emp_no','salary','from_date','to_date']
16 |
17 | #list of fields to display in the table
18 | #LIST_DISPLAY = ['emp_no','salary','from_date','to_date']
19 |
20 | #fields to be used in the search
21 | #SEARCH_FIELDS = ['emp_no','salary','from_date','to_date']
22 |
23 | #sub models to show in the interface
24 | #INLINES = []
25 |
26 | #formset of the edit form
27 | #FIELDSETS = ['emp_no','salary','from_date','to_date']
28 |
29 | #read only fields
30 | #READ_ONLY = ['emp_no','salary','from_date','to_date']
31 |
32 | #EDITFORM_CLASS = SalariesModelFormWidget #edit form class
33 | #CONTROL_LIST = ControlQueryList #Control to be used in to list the values
34 |
35 | #AUTHORIZED_GROUPS = ['superuser'] #groups with authorization to visualize the app
36 |
37 | ########################################################
38 | #### ORQUESTRA CONFIGURATION ###########################
39 | ########################################################
40 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
41 | ORQUESTRA_MENU = 'left>DepartmentsAdminApp'
42 | ORQUESTRA_MENU_ORDER = 0
43 | ORQUESTRA_MENU_ICON = 'dollar'
44 | ########################################################
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tutorials/tutorial_advance_db/tutorial_apps/apps/titles_app.py:
--------------------------------------------------------------------------------
1 | from confapp import conf
2 | from pyforms_web.widgets.django import ModelAdminWidget
3 |
4 | from tutorial.models import Titles
5 |
6 | class TitlesAdminApp(ModelAdminWidget):
7 |
8 |
9 | UID = 'tutorial-Titles-app'.lower()
10 | MODEL = Titles
11 |
12 | TITLE = 'Titless'
13 |
14 | #list of filters fields
15 | #LIST_FILTER = ['emp_no','title','from_date','to_date']
16 |
17 | #list of fields to display in the table
18 | #LIST_DISPLAY = ['emp_no','title','from_date','to_date']
19 |
20 | #fields to be used in the search
21 | #SEARCH_FIELDS = ['emp_no','title','from_date','to_date']
22 |
23 | #sub models to show in the interface
24 | #INLINES = []
25 |
26 | #formset of the edit form
27 | #FIELDSETS = ['emp_no','title','from_date','to_date']
28 |
29 | #read only fields
30 | #READ_ONLY = ['emp_no','title','from_date','to_date']
31 |
32 | #EDITFORM_CLASS = TitlesModelFormWidget #edit form class
33 | #CONTROL_LIST = ControlQueryList #Control to be used in to list the values
34 |
35 | #AUTHORIZED_GROUPS = ['superuser'] #groups with authorization to visualize the app
36 |
37 | ########################################################
38 | #### ORQUESTRA CONFIGURATION ###########################
39 | ########################################################
40 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
41 | ORQUESTRA_MENU = 'left>DepartmentsAdminApp'
42 | ORQUESTRA_MENU_ORDER = 0
43 | ORQUESTRA_MENU_ICON = 'dollar'
44 | ########################################################
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/db.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_inheritance/db.sqlite3
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/local_settings.py:
--------------------------------------------------------------------------------
1 | SETTINGS_PRIORITY = 0 # Will define this settings file as priority. Will override all the settings with lower priority.
2 | PYFORMS_MODE = 'WEB' # Will configure pyforms to run as WEB mode.
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/lockfile.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_inheritance/lockfile.txt
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tutorial_inheritance.settings')
9 | try:
10 | from django.core.management import execute_from_command_line
11 | except ImportError as exc:
12 | raise ImportError(
13 | "Couldn't import Django. Are you sure it's installed and "
14 | "available on your PYTHONPATH environment variable? Did you "
15 | "forget to activate a virtual environment?"
16 | ) from exc
17 | execute_from_command_line(sys.argv)
18 |
19 |
20 | if __name__ == '__main__':
21 | main()
22 |
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_inheritance/tutorial/__init__.py
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/__init__.py:
--------------------------------------------------------------------------------
1 | from .app_one import AppOne
2 | from .app_two import AppTwo
3 | from .multiple_inheritance import MultipleHeritage
4 | from .inheritance import Heritage
5 | from .inheritance_v2 import HeritageV2
6 | from .inheritance_v3 import HeritageV3
7 | from .open_inheritancev3 import OpenHeritageV3
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/app_one.py:
--------------------------------------------------------------------------------
1 | from pyforms.basewidget import BaseWidget
2 | from confapp import conf
3 | from pyforms.controls import ControlDecimal
4 | from pyforms.controls import ControlButton
5 | from pyforms.controls import ControlList
6 | import random
7 | from decimal import Decimal
8 |
9 | class AppOne(BaseWidget):
10 |
11 | UID = 'app-one'
12 | TITLE = 'App one'
13 |
14 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
15 | ORQUESTRA_MENU = 'left'
16 | ORQUESTRA_MENU_ICON = 'cog'
17 | ORQUESTRA_MENU_ORDER = 0
18 |
19 | def __init__(self, *args, **kwargs):
20 | self._table = ControlList('Values')
21 |
22 | super().__init__(*args, **kwargs)
23 |
24 | self._ndata = ControlDecimal('Number of values to generate', default=Decimal(3))
25 | self._btn = ControlButton('Generate', default=self.btn_evt)
26 |
27 | self.formset = ['_ndata', '_btn', '_table']
28 |
29 | def generate(self):
30 | data = []
31 | n = int(self._ndata.value)
32 | for i in range(n):
33 | data.append( (str(i), random.randint(0,1000)) )
34 | return data
35 |
36 | def btn_evt(self):
37 | self._table.value = self.generate()
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/app_two.py:
--------------------------------------------------------------------------------
1 | from pyforms.basewidget import BaseWidget
2 | from confapp import conf
3 | from pyforms.controls import ControlTextArea
4 |
5 | class AppTwo(BaseWidget):
6 |
7 | UID = 'app-two'
8 | TITLE = 'App two'
9 |
10 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
11 |
12 | ORQUESTRA_MENU = 'left'
13 | ORQUESTRA_MENU_ICON = 'browser'
14 | ORQUESTRA_MENU_ORDER = 1
15 |
16 | def __init__(self, *args, **kwargs):
17 | super().__init__(*args, **kwargs)
18 |
19 | self._table = ControlTextArea('Values')
20 |
21 | self.formset = ['_table']
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/inheritance.py:
--------------------------------------------------------------------------------
1 | from pyforms.controls import ControlTextArea
2 | from .app_one import AppOne
3 |
4 | class Heritage(AppOne):
5 |
6 | UID = 'heritage'
7 | TITLE = 'Heritage'
8 |
9 | ORQUESTRA_MENU_ORDER = 4
10 |
11 | def __init__(self, *args, **kwargs):
12 | super().__init__(*args, **kwargs)
13 |
14 | self._table = ControlTextArea('Values')
15 |
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/inheritance_v2.py:
--------------------------------------------------------------------------------
1 | from pyforms.controls import ControlButton
2 | from .inheritance import Heritage
3 |
4 | class HeritageV2(Heritage):
5 |
6 | UID = 'heritage-v2'
7 | TITLE = 'Heritage v2'
8 |
9 | ORQUESTRA_MENU_ORDER = 5
10 |
11 | def __init__(self, *args, **kwargs):
12 | super().__init__(*args, **kwargs)
13 |
14 | self._togglebtn = ControlButton('Hide / Show', default=self.__togglebnt_evt, css='yellow')
15 |
16 | self.formset = [
17 | ('_ndata', ' '),
18 | ('_btn', '_togglebtn'),
19 | '_table'
20 | ]
21 |
22 | def __togglebnt_evt(self):
23 | if self._table.visible:
24 | self._table.hide()
25 | else:
26 | self._table.show()
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/inheritance_v3.py:
--------------------------------------------------------------------------------
1 | from .inheritance_v2 import HeritageV2
2 | from confapp import conf
3 |
4 | class HeritageV3(HeritageV2):
5 |
6 | UID = 'heritage-v3'
7 | TITLE = 'Heritage v3'
8 |
9 | ORQUESTRA_MENU_ORDER = 6
10 |
11 | LAYOUT_POSITION = conf.ORQUESTRA_NEW_WINDOW
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/multiple_inheritance.py:
--------------------------------------------------------------------------------
1 | from .app_one import AppOne
2 | from .app_two import AppTwo
3 |
4 | class MultipleHeritage(AppOne, AppTwo):
5 |
6 | UID = 'multiple-heritage'
7 | TITLE = 'Multiple heritage'
8 |
9 | ORQUESTRA_MENU_ORDER = 1
10 |
11 | def __init__(self, *args, **kwargs):
12 | super().__init__(*args, **kwargs)
13 |
14 |
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial/apps/open_inheritancev3.py:
--------------------------------------------------------------------------------
1 | from pyforms.basewidget import BaseWidget
2 | from confapp import conf
3 | from pyforms.controls import ControlButton
4 | from .inheritance_v3 import HeritageV3
5 |
6 | class OpenHeritageV3(BaseWidget):
7 |
8 | UID = 'app-heritagev3'
9 | TITLE = 'Open heritage v3'
10 |
11 | LAYOUT_POSITION = conf.ORQUESTRA_HOME
12 | ORQUESTRA_MENU = 'left'
13 | ORQUESTRA_MENU_ICON = 'cog'
14 | ORQUESTRA_MENU_ORDER = 7
15 |
16 | def __init__(self, *args, **kwargs):
17 | super().__init__(*args, **kwargs)
18 |
19 | self._btn = ControlButton('Open heritage v3', default=self.btn_evt)
20 |
21 | self.formset = ['_btn']
22 |
23 | def btn_evt(self):
24 | HeritageV3()
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial_inheritance/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-web/4cf1d714325e21d499bb3d294436a8b127b6cdc3/tutorials/tutorial_inheritance/tutorial_inheritance/__init__.py
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial_inheritance/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for tutorial_inheritance project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tutorial_inheritance.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial_inheritance/urls.py:
--------------------------------------------------------------------------------
1 | """tutorial_inheritance URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.conf import settings
17 | from django.contrib import admin
18 | from django.urls import include, path
19 |
20 | urlpatterns = [
21 | path('pyforms/', include('pyforms_web.web.urls') ),
22 | path('', include('orquestra.urls') ),
23 | ]
24 |
25 | if settings.DEBUG:
26 | from django.conf.urls.static import static
27 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
--------------------------------------------------------------------------------
/tutorials/tutorial_inheritance/tutorial_inheritance/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for tutorial_inheritance project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tutorial_inheritance.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------