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
import { | |
Admin, | |
ArrayInput, | |
Create, | |
CreateButton, | |
Datagrid, | |
DateField, | |
Edit, | |
EditButton, | |
FilterButton, |
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
import json | |
import re | |
from typing import List, Tuple, Annotated | |
from beanie import PydanticObjectId | |
from bson import ObjectId | |
from fastapi import APIRouter, HTTPException, Depends, Response | |
from starlette import status | |
from auth import has_permission, cookie, SessionData, verifier |
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
import re | |
from pathlib import Path | |
from django.urls import path | |
from django.views import View | |
from parts.templatetags.url_replace import url_replace | |
def walk_views(cls=View): |
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
from urllib.parse import urljoin | |
from django.core.paginator import Paginator, Page | |
from dataclasses import dataclass | |
from django.utils.safestring import mark_safe | |
@dataclass | |
class PageLink: |
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
import json | |
from urllib.parse import parse_qs | |
from django.conf import settings | |
from django.contrib.auth import login, get_user_model | |
from aiogram.utils.web_app import check_webapp_signature | |
from rest_framework.authentication import TokenAuthentication, BaseAuthentication, exceptions | |
class MiniAppAuthenication(BaseAuthentication): |
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
document.addEventListener('DOMContentLoaded', function () { | |
const $=window.django.jQuery | |
$( "#changelist-search" ).on( "submit", function( event ) { | |
let new_url = location.href.split('?')[0] +'?' + $( this ).serialize() | |
window.sel=[] | |
$('input.action-select').each(function(){ | |
if(this.checked) { | |
window.sel.push(this.value) | |
} |
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
'use strict'; | |
var fs = require('fs'); | |
var user_db = require('../models/user'); | |
var ban_db = require('../models/ban'); | |
var get_user_ip = require('./get-user-ip'); | |
var path = require('path'); | |
var config = require('../../config'); |
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
#!/usr/bin/python | |
from Xlib import X,XK,display | |
import sys,os | |
import gobject | |
class Hotkey: | |
def __init__(self,keystr,action,*args): | |
self.action=action | |
self.args=args |