A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
<?php | |
# Fill our vars and run on cli | |
# $ php -f db-connect-test.php | |
$dbname = 'name'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; | |
$dbhost = 'host'; | |
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
# -- coding: utf-8 -- | |
from odoo import models, api | |
class StockMove(models.Model): | |
_inherit = 'stock.move' | |
def _update_qty_done(self, qty_done, product_id=None, move_line_ids=None, location_id=None, location_dest_id=None lot_id=None, package_id=None, owner_id=None, has_existence=True): | |
self.ensure_one() |
# -- coding: utf-8 -- | |
from odoo import models, api, fields, _ | |
from odoo.exceptions import ValidationError | |
class StockMove(models.Model): | |
_inherit = 'stock.move' | |
def _update_qty_done(self, qty_done, product_id=None, move_line_ids=None, location_id=None, location_dest_id=None, | |
lot_id=None, package_id=None, owner_id=None, has_existence=True, done_move=False): |
package main | |
import ( | |
"html/template" | |
"os" | |
"path/filepath" | |
) | |
// ParseTemplateDir parse dirs | |
// Example: var templates = template.Must(ParseTemplateDir("templates")) |
To use Pyside2 as a framework to build a Windows GUI Program.
Build pages as class containers of pages simliar to how Sentdex has done this beautifully with Tkinter here https://www.youtube.com/watch?v=A0gaXfM1UN0&list=PLQVvvaa0QuDclKx-QpC9wntnURXVJqLyk&index=2
The first listed resource is a Stack Overflow answer from a while ago and mostly what my code is
<?xml encoding="UTF-8"?> | |
<!ELEMENT odoo (record*|menuitem*)> | |
<!ATTLIST odoo | |
xmlns CDATA #FIXED '' | |
noupdate CDATA #IMPLIED | |
> | |
<!ELEMENT record (field+)> | |
<!ATTLIST record |
<?xml version="1.0" encoding="UTF-8"?> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | |
<!-- START MY --> | |
<xs:element name="div"> | |
<xs:complexType> | |
<xs:sequence> | |
<xs:group ref="overload" /> | |
<xs:choice minOccurs="0" maxOccurs="unbounded"> | |
<xs:element ref="field" /> |
from odoo import models, fields, api | |
from json_field import JsonField | |
class Person(models.Model): | |
_name = 'example.person' | |
_description = 'Person with json details' | |
details = JsonField() # a json object represented as dict / list / python primitives |
print('hello') |