-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/0.1: bump version updates CI updates CI updates CI updates CI updates add slug add docs and FieldDefinition.content_type add pre-commit.yaml add missed migration improves ValidatorMixi updates add auto-updateb of ContentType based Fieldset bug fixing bug fixing updates README reset migrations
- Loading branch information
Showing
62 changed files
with
1,339 additions
and
1,967 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ dist/ | |
build/ | ||
coverage.xml | ||
*.sqlite3 | ||
Makefile | ||
uv.lock | ||
!.git | ||
!.github | ||
!.flake8 | ||
|
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.align-center{ | ||
align-content: center; | ||
text-align: center; | ||
width: 100%; | ||
} | ||
.md-typeset__table { | ||
width: 100%; | ||
} | ||
|
||
.md-typeset__table table:not([class]) { | ||
display: table | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const clickHandler = function () { | ||
let currentAddr = Cookies.get('address') || "https://127.0.0.1/"; | ||
let addr = prompt("Set your HOPE server address", currentAddr); | ||
Cookies.set('address', addr, currentAddr); | ||
location.reload(); | ||
}; | ||
const setAddress = function () { | ||
let cookieAddr = Cookies.get('address'); | ||
if (!cookieAddr) { | ||
cookieAddr = "[SERVER_ADDRESS]" | ||
} | ||
for (const cell of document.getElementsByTagName('code')) { | ||
cell.innerHTML = cell.innerHTML.replace('[SERVER_ADDRESS]', cookieAddr); | ||
} | ||
}; | ||
// addEventListener('click', function(e) { | ||
// setTimeout(setAddress, 500); | ||
// }) | ||
addEventListener('load', function (e) { | ||
setAddress(); | ||
let btn = document.getElementById("set-address"); | ||
if (btn) { | ||
btn.addEventListener('click', clickHandler); | ||
} | ||
}); | ||
|
||
var open = window.XMLHttpRequest.prototype.open, | ||
send = window.XMLHttpRequest.prototype.send, onReadyStateChange; | ||
|
||
function sendReplacement(data) { | ||
console.warn('Sending HTTP request data : ', data); | ||
|
||
if (this.onreadystatechange) { | ||
this._onreadystatechange = this.onreadystatechange; | ||
} | ||
this.onreadystatechange = onReadyStateChangeReplacement; | ||
return send.apply(this, arguments); | ||
} | ||
|
||
function onReadyStateChangeReplacement() { | ||
if (this.readyState === XMLHttpRequest.DONE) { | ||
setTimeout(setAddress, 100); | ||
} | ||
if (this._onreadystatechange) { | ||
return this._onreadystatechange.apply(this, arguments); | ||
} | ||
|
||
} | ||
|
||
window.XMLHttpRequest.prototype.send = sendReplacement; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/*! js-cookie v3.0.5 | MIT */ | ||
!function (e, t) { | ||
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self, function () { | ||
var n = e.Cookies, o = e.Cookies = t(); | ||
o.noConflict = function () { | ||
return e.Cookies = n, o | ||
} | ||
}()) | ||
}(this, (function () { | ||
"use strict"; | ||
|
||
function e(e) { | ||
for (var t = 1; t < arguments.length; t++) { | ||
var n = arguments[t]; | ||
for (var o in n) e[o] = n[o] | ||
} | ||
return e | ||
} | ||
|
||
var t = function t(n, o) { | ||
function r(t, r, i) { | ||
if ("undefined" != typeof document) { | ||
"number" == typeof (i = e({}, o, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), t = encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); | ||
var c = ""; | ||
for (var u in i) i[u] && (c += "; " + u, !0 !== i[u] && (c += "=" + i[u].split(";")[0])); | ||
return document.cookie = t + "=" + n.write(r, t) + c | ||
} | ||
} | ||
|
||
return Object.create({ | ||
set: r, get: function (e) { | ||
if ("undefined" != typeof document && (!arguments.length || e)) { | ||
for (var t = document.cookie ? document.cookie.split("; ") : [], o = {}, r = 0; r < t.length; r++) { | ||
var i = t[r].split("="), c = i.slice(1).join("="); | ||
try { | ||
var u = decodeURIComponent(i[0]); | ||
if (o[u] = n.read(c, u), e === u) break | ||
} catch (e) { | ||
} | ||
} | ||
return e ? o[e] : o | ||
} | ||
}, remove: function (t, n) { | ||
r(t, "", e({}, n, {expires: -1})) | ||
}, withAttributes: function (n) { | ||
return t(this.converter, e({}, this.attributes, n)) | ||
}, withConverter: function (n) { | ||
return t(e({}, this.converter, n), this.attributes) | ||
} | ||
}, {attributes: {value: Object.freeze(o)}, converter: {value: Object.freeze(n)}}) | ||
}({ | ||
read: function (e) { | ||
return '"' === e[0] && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent) | ||
}, write: function (e) { | ||
return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent) | ||
} | ||
}, {path: "/"}); | ||
return t | ||
})); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "base.html" %} | ||
{%- block content %} | ||
<h5><a href="../../">glossary</a> / {{ page.title }}</h5> | ||
{{ super() }} | ||
{%- endblock %} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
!**/.pages | ||
!.includes | ||
_theme/.templates |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
nav: | ||
- Home: index.md | ||
- install.md | ||
- contributing.md | ||
- reference.md | ||
- examples.md |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Best Practices | ||
|
||
|
||
!!! note "General best practices" | ||
|
||
- Always return any "readable" value (es. True) | ||
- Uses [Persistent revokes](https://docs.celeryq.dev/en/stable/userguide/workers.html#worker-persistent-revokes) | ||
|
||
|
||
## Display progress | ||
|
||
Inform what is happening inside your task | ||
|
||
@celery.task(bind=True) | ||
def long_task(self)-> bool: | ||
record = 1 | ||
|
||
for entry in Model.objects.all(): | ||
self.update_state(state='PROGRESS', meta={'current': record, 'entry': str(entry)}) | ||
record += 1 | ||
return True | ||
|
||
|
||
## Sentry Integration | ||
|
||
In case you use [Sentry](https://sentry.io/), add some useful information | ||
|
||
from functools import wraps | ||
|
||
def sentry_tags(func: Callable) -> Callable: | ||
@wraps(func) | ||
def wrapper(*args: Any, **kwargs: Any) -> Any: | ||
with configure_scope() as scope: | ||
scope.set_tag("celery", True) | ||
scope.set_tag("celery_task", func.__name__) | ||
return func(*args, **kwargs) | ||
|
||
return wrapper | ||
|
||
@celery.task(bind=True) | ||
@sentry_tags | ||
def task(self) -> bool: | ||
... | ||
return True |
Oops, something went wrong.