This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeAjaxCall(url, methodType, callback){ | |
return $.ajax({ | |
url : url, | |
method : methodType, | |
dataType : "json" | |
}) | |
} | |
let data = serializeForm(document.getElementById('form_pv')); | |
makeAjaxCall(urlCreatePV, data, 'POST').then(function(respJson){ | |
if (respJson.ok == false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load widget_tweaks %} | |
{% load common_tags %} | |
<form id="form_page" method="POST" action=""> | |
{% csrf_token %} | |
{% for field in form.hidden_fields %} | |
{{ field }} | |
{% endfor %} | |
{% for field in form.visible_fields %} | |
{% if field|is_checkbox %} | |
<div class="form-check"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Forms | |
----- | |
- Double points at the end of labels. | |
- By preference use form horizontal. | |
- Use (*) and bold style for mandatory fields. | |
- "Save" button must have primary color and be on the very right side. | |
- "Close" button must have secondary color and be left side of "Save". | |
- "Delete" button must have danger color and be left side of the whole window. | |
Tables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load widget_tweaks %} | |
<form class="form-inline"> | |
{% for field in form.visible_fields %} | |
{% render_field field class='form-control mb-2 mr-sm-2' placeholder=field.label %} | |
{% endfor %} | |
<button type="submit" class="btn btn-primary mb-2">{% trans 'Search' %}</button> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Download last version of Python wheel: https://www.pgadmin.org/download/pgadmin-4-python-wheel/ | |
2. Install wheel | |
mkdir ~/pgadmin4 | |
cd ~/pgadmin4 | |
python3.X -m venv venv | |
. venv/bin/activate | |
pip install pgadmin4-X.X-py2.py3-none-any.whl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sends a request through fetch using async / await. | |
* @param {Object} request | |
*/ | |
async function makeRequestCall(request) { | |
const response = await fetch(request); | |
const json = await response.json(); | |
if (!response.ok) { | |
let error = new Error(response.statusText); | |
error.response = response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Download wheel (last version) | |
https://www.pgadmin.org/download/pgadmin-4-python-wheel/ | |
2. Create /opt/pgadmin4 | |
3. Create / activate virtual environment | |
cd /opt/pgadmin4 | |
python3 -m venv venv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Database | |
-------- | |
Functions (sp_) | |
Triggers (tr_) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. pg_lsclusters | |
2. Stop all clusters, even the new one you want to use. | |
pg_ctlcluster <version> main stop | |
3. cd /tmp | |
4. sudo -H -u postgres /usr/lib/postgresql/12/bin/pg_upgrade \ | |
-b /usr/lib/postgresql/10/bin \ |