mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 19:14:30 +00:00
5616 lines
236 KiB
HTML
5616 lines
236 KiB
HTML
|
|
||
|
<!doctype html>
|
||
|
<html lang="fr" class="no-js">
|
||
|
<head>
|
||
|
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
|
||
|
<meta name="description" content="Le site de l'association des étudiants de l'UTBM">
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="canonical" href="https://ae-utbm.github.io/sith/reference/rootplace/views/">
|
||
|
|
||
|
|
||
|
<link rel="prev" href="../models/">
|
||
|
|
||
|
|
||
|
<link rel="next" href="../../sas/models/">
|
||
|
|
||
|
|
||
|
<link rel="icon" href="../../../img/favicon.png">
|
||
|
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.40">
|
||
|
|
||
|
|
||
|
|
||
|
<title>Views - Site AE UTBM</title>
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../../../assets/stylesheets/main.8c3ca2c6.min.css">
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../../../assets/stylesheets/palette.06af60db.min.css">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
|
||
|
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../../../assets/_mkdocstrings.css">
|
||
|
|
||
|
<link rel="stylesheet" href="../../../stylesheets/extra.css">
|
||
|
|
||
|
<script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</head>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="deeppurple" data-md-color-accent="deeppurple">
|
||
|
|
||
|
|
||
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||
|
<label class="md-overlay" for="__drawer"></label>
|
||
|
<div data-md-component="skip">
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.OperationLog" class="md-skip">
|
||
|
Aller au contenu
|
||
|
</a>
|
||
|
|
||
|
</div>
|
||
|
<div data-md-component="announce">
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<header class="md-header md-header--shadow" data-md-component="header">
|
||
|
<nav class="md-header__inner md-grid" aria-label="En-tête">
|
||
|
<a href="../../.." title="Site AE UTBM" class="md-header__button md-logo" aria-label="Site AE UTBM" data-md-component="logo">
|
||
|
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
||
|
|
||
|
</a>
|
||
|
<label class="md-header__button md-icon" for="__drawer">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
|
||
|
</label>
|
||
|
<div class="md-header__title" data-md-component="header-title">
|
||
|
<div class="md-header__ellipsis">
|
||
|
<div class="md-header__topic">
|
||
|
<span class="md-ellipsis">
|
||
|
Site AE UTBM
|
||
|
</span>
|
||
|
</div>
|
||
|
<div class="md-header__topic" data-md-component="header-topic">
|
||
|
<span class="md-ellipsis">
|
||
|
|
||
|
Views
|
||
|
|
||
|
</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<form class="md-header__option" data-md-component="palette">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="deeppurple" data-md-color-accent="deeppurple" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
|
||
|
|
||
|
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3 3 0 0 1-3 3"/></svg>
|
||
|
</label>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="blue" data-md-color-accent="blue" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
|
||
|
|
||
|
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6m0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4M7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"/></svg>
|
||
|
</label>
|
||
|
|
||
|
|
||
|
</form>
|
||
|
|
||
|
|
||
|
|
||
|
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
|
||
|
|
||
|
|
||
|
|
||
|
<label class="md-header__button md-icon" for="__search">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
||
|
</label>
|
||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||
|
<label class="md-search__overlay" for="__search"></label>
|
||
|
<div class="md-search__inner" role="search">
|
||
|
<form class="md-search__form" name="search">
|
||
|
<input type="text" class="md-search__input" name="query" aria-label="Rechercher" placeholder="Rechercher" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
||
|
<label class="md-search__icon md-icon" for="__search">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
|
||
|
</label>
|
||
|
<nav class="md-search__options" aria-label="Recherche">
|
||
|
|
||
|
<button type="reset" class="md-search__icon md-icon" title="Effacer" aria-label="Effacer" tabindex="-1">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
|
||
|
</button>
|
||
|
</nav>
|
||
|
|
||
|
</form>
|
||
|
<div class="md-search__output">
|
||
|
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
|
||
|
<div class="md-search-result" data-md-component="search-result">
|
||
|
<div class="md-search-result__meta">
|
||
|
Initialisation de la recherche
|
||
|
</div>
|
||
|
<ol class="md-search-result__list" role="presentation"></ol>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<div class="md-header__source">
|
||
|
<a href="https://github.com/ae-utbm/sith" title="Aller au dépôt" class="md-source" data-md-component="source">
|
||
|
<div class="md-source__icon md-icon">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
|
||
|
</div>
|
||
|
<div class="md-source__repository">
|
||
|
sith
|
||
|
</div>
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
</nav>
|
||
|
|
||
|
</header>
|
||
|
|
||
|
<div class="md-container" data-md-component="container">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<main class="md-main" data-md-component="main">
|
||
|
<div class="md-main__inner md-grid">
|
||
|
|
||
|
|
||
|
|
||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
||
|
<div class="md-sidebar__scrollwrap">
|
||
|
<div class="md-sidebar__inner">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||
|
<label class="md-nav__title" for="__drawer">
|
||
|
<a href="../../.." title="Site AE UTBM" class="md-nav__button md-logo" aria-label="Site AE UTBM" data-md-component="logo">
|
||
|
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
||
|
|
||
|
</a>
|
||
|
Site AE UTBM
|
||
|
</label>
|
||
|
|
||
|
<div class="md-nav__source">
|
||
|
<a href="https://github.com/ae-utbm/sith" title="Aller au dépôt" class="md-source" data-md-component="source">
|
||
|
<div class="md-source__icon md-icon">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
|
||
|
</div>
|
||
|
<div class="md-source__repository">
|
||
|
sith
|
||
|
</div>
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../.." class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Accueil
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Explications
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_2">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
Explications
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../explanation/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Accueil
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../explanation/technos/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Technologies utilisées
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../explanation/conventions/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Conventions
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../explanation/archives/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Archives
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Tutoriels
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_3">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
Tutoriels
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../tutorial/install/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Installer le projet
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../tutorial/install-advanced/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Installer le projet (avancé)
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../tutorial/devtools/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Configurer son éditeur
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../tutorial/structure/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Structure du projet
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../tutorial/perms/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Gestion des permissions
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../tutorial/groups/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Gestion des groupes
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../tutorial/etransaction/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Etransactions
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
How-to
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_4">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
How-to
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/querysets/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
L'ORM de Django
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/migrations/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Gérer les migrations
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/translation/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Gérer les traductions
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/statics/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Gérer les statics
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/js-import-paths/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Ajouter un chemin d'import javascript
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/prod/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Configurer pour la production
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/logo/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Ajouter un logo de promo
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/subscriptions/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Ajouter une cotisation
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/weekmail/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Modifier le weekmail
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/terminal/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Terminal
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../../howto/direnv/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Direnv
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" checked>
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Reference
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="true">
|
||
|
<label class="md-nav__title" for="__nav_5">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
Reference
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_1" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_1" id="__nav_5_1_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
accounting
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_1_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_1">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
accounting
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../accounting/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../accounting/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
antispam
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_2">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
antispam
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../antispam/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../antispam/forms/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Forms
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_3" id="__nav_5_3_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
club
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_3_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_3">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
club
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../club/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../club/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_4" id="__nav_5_4_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
com
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_4_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_4">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
com
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../com/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../com/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_5" id="__nav_5_5_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
core
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_5_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_5">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
core
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../core/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../core/model_fields/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Champs de modèle
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../core/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../core/schemas/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Schemas
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../core/api_permissions/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Api permissions
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_6" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_6" id="__nav_5_6_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
counter
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_6_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_6">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
counter
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../counter/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../counter/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../counter/schemas/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Schemas
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_7" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_7" id="__nav_5_7_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
eboutic
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_7_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_7">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
eboutic
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../eboutic/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../eboutic/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_8" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_8" id="__nav_5_8_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
election
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_8_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_8">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
election
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../election/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../election/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_9" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_9" id="__nav_5_9_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
forum
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_9_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_9">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
forum
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../forum/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../forum/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_10" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_10" id="__nav_5_10_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
galaxy
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_10_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_10">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
galaxy
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../galaxy/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../galaxy/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_11" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_11" id="__nav_5_11_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
launderette
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_11_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_11">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
launderette
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../launderette/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../launderette/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_12" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_12" id="__nav_5_12_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
matmat
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_12_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_12">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
matmat
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../matmat/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../matmat/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_13" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_13" id="__nav_5_13_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
pedagogy
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_13_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_13">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
pedagogy
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../pedagogy/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../pedagogy/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../pedagogy/schemas/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Schemas
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_14" checked>
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_14" id="__nav_5_14_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
rootplace
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_14_label" aria-expanded="true">
|
||
|
<label class="md-nav__title" for="__nav_5_14">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
rootplace
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--active">
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
|
||
|
|
||
|
|
||
|
|
||
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<a href="./" class="md-nav__link md-nav__link--active">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
<nav class="md-nav md-nav--secondary" aria-label="Table des matières">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<label class="md-nav__title" for="__toc">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
Table des matières
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.OperationLog" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
OperationLog
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
SithFile
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
<nav class="md-nav" aria-label="SithFile">
|
||
|
<ul class="md-nav__list">
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.clean" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
clean
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.apply_rights_recursively" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
apply_rights_recursively
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.copy_rights" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
copy_rights
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.move_to" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
move_to
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
User
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
<nav class="md-nav" aria-label="User">
|
||
|
<ul class="md-nav__list">
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.cached_groups" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
cached_groups
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.is_in_group" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
is_in_group
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.age" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
age
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_full_name" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_full_name
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_short_name" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_short_name
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_display_name" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_display_name
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_age" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_age
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_family" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_family
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.email_user" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
email_user
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.generate_username" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
generate_username
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.is_owner" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
is_owner
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.can_edit" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
can_edit
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.can_view" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
can_view
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.clubs_with_rights" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
clubs_with_rights
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.CanEditPropMixin" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
CanEditPropMixin
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
Customer
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
<nav class="md-nav" aria-label="Customer">
|
||
|
<ul class="md-nav__list">
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer.can_buy" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
can_buy
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer.save" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
save
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer.get_or_create" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_or_create
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.ForumMessageMeta" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
ForumMessageMeta
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.MergeForm" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
MergeForm
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SelectUserForm" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
SelectUserForm
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.MergeUsersView" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
MergeUsersView
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.DeleteAllForumUserMessagesView" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
DeleteAllForumUserMessagesView
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.OperationLogListView" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
OperationLogListView
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.__merge_subscriptions" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
__merge_subscriptions
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.__merge_pictures" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
__merge_pictures
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.merge_users" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
merge_users
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.delete_all_forum_user_messages" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
delete_all_forum_user_messages
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_15" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_15" id="__nav_5_15_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
sas
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_15_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_15">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
sas
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../sas/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../sas/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../sas/schemas/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Schemas
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_16" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_16" id="__nav_5_16_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
staticfiles
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_16_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_16">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
staticfiles
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../staticfiles/apps/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Apps
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../staticfiles/storage/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Storage
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../staticfiles/finders/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Finders
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../staticfiles/processors/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Processors
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_17" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_17" id="__nav_5_17_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
subscription
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_17_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_17">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
subscription
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../subscription/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../subscription/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item md-nav__item--nested">
|
||
|
|
||
|
|
||
|
|
||
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_18" >
|
||
|
|
||
|
|
||
|
<label class="md-nav__link" for="__nav_5_18" id="__nav_5_18_label" tabindex="0">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
trombi
|
||
|
</span>
|
||
|
|
||
|
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
</label>
|
||
|
|
||
|
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_18_label" aria-expanded="false">
|
||
|
<label class="md-nav__title" for="__nav_5_18">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
trombi
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../trombi/models/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Models
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="../../trombi/views/" class="md-nav__link">
|
||
|
|
||
|
|
||
|
<span class="md-ellipsis">
|
||
|
Views
|
||
|
</span>
|
||
|
|
||
|
|
||
|
</a>
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
||
|
<div class="md-sidebar__scrollwrap">
|
||
|
<div class="md-sidebar__inner">
|
||
|
|
||
|
|
||
|
<nav class="md-nav md-nav--secondary" aria-label="Table des matières">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<label class="md-nav__title" for="__toc">
|
||
|
<span class="md-nav__icon md-icon"></span>
|
||
|
Table des matières
|
||
|
</label>
|
||
|
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.OperationLog" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
OperationLog
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
SithFile
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
<nav class="md-nav" aria-label="SithFile">
|
||
|
<ul class="md-nav__list">
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.clean" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
clean
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.apply_rights_recursively" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
apply_rights_recursively
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.copy_rights" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
copy_rights
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SithFile.move_to" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
move_to
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
User
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
<nav class="md-nav" aria-label="User">
|
||
|
<ul class="md-nav__list">
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.cached_groups" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
cached_groups
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.is_in_group" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
is_in_group
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.age" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
age
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_full_name" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_full_name
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_short_name" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_short_name
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_display_name" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_display_name
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_age" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_age
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.get_family" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_family
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.email_user" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
email_user
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.generate_username" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
generate_username
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.is_owner" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
is_owner
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.can_edit" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
can_edit
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.can_view" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
can_view
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.User.clubs_with_rights" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
clubs_with_rights
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.CanEditPropMixin" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
CanEditPropMixin
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
Customer
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
<nav class="md-nav" aria-label="Customer">
|
||
|
<ul class="md-nav__list">
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer.can_buy" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
can_buy
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer.save" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
save
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.Customer.get_or_create" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
get_or_create
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
</nav>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.ForumMessageMeta" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
ForumMessageMeta
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.MergeForm" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
MergeForm
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.SelectUserForm" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
SelectUserForm
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.MergeUsersView" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
MergeUsersView
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.DeleteAllForumUserMessagesView" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
DeleteAllForumUserMessagesView
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.OperationLogListView" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
OperationLogListView
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.__merge_subscriptions" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
__merge_subscriptions
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.__merge_pictures" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
__merge_pictures
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.merge_users" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
merge_users
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="md-nav__item">
|
||
|
<a href="#rootplace.views.delete_all_forum_user_messages" class="md-nav__link">
|
||
|
<span class="md-ellipsis">
|
||
|
delete_all_forum_user_messages
|
||
|
</span>
|
||
|
</a>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</nav>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="md-content" data-md-component="content">
|
||
|
<article class="md-content__inner md-typeset">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<h1>Views</h1>
|
||
|
|
||
|
<div class="doc doc-object doc-module">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents first">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.OperationLog" class="doc doc-heading">
|
||
|
<code>OperationLog</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.OperationLog" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>Model</code></p>
|
||
|
|
||
|
|
||
|
<p>General purpose log object to register operations.</p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.SithFile" class="doc doc-heading">
|
||
|
<code>SithFile</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.SithFile" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>Model</code></p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.SithFile.clean" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">clean</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.SithFile.clean" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Cleans up the file.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1022">1022</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1023">1023</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1024">1024</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1025">1025</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1026">1026</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1027">1027</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1028">1028</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1029">1029</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1030">1030</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1031">1031</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1032">1032</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1033">1033</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1034">1034</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1035">1035</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1036">1036</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1037">1037</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1038">1038</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1039">1039</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1040">1040</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1041">1041</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1042">1042</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1043">1043</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1044">1044</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1045">1045</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1046">1046</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1047">1047</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1048">1048</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1049">1049</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1050">1050</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1051">1051</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1052">1052</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1053">1053</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1054">1054</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1055">1055</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1056">1056</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1057">1057</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1058">1058</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1059">1059</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1060">1060</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1061">1061</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1062">1062</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1063">1063</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1022"><a id="__codelineno-0-1022" name="__codelineno-0-1022"></a><span class="k">def</span> <span class="nf">clean</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-1023"><a id="__codelineno-0-1023" name="__codelineno-0-1023"></a><span class="w"> </span><span class="sd">"""Cleans up the file."""</span>
|
||
|
</span><span id="__span-0-1024"><a id="__codelineno-0-1024" name="__codelineno-0-1024"></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">clean</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-1025"><a id="__codelineno-0-1025" name="__codelineno-0-1025"></a> <span class="k">if</span> <span class="s2">"/"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1026"><a id="__codelineno-0-1026" name="__codelineno-0-1026"></a> <span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s2">"Character '/' not authorized in name"</span><span class="p">))</span>
|
||
|
</span><span id="__span-0-1027"><a id="__codelineno-0-1027" name="__codelineno-0-1027"></a> <span class="k">if</span> <span class="bp">self</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1028"><a id="__codelineno-0-1028" name="__codelineno-0-1028"></a> <span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s2">"Loop in folder tree"</span><span class="p">),</span> <span class="n">code</span><span class="o">=</span><span class="s2">"loop"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1029"><a id="__codelineno-0-1029" name="__codelineno-0-1029"></a> <span class="k">if</span> <span class="bp">self</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="ow">or</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-1030"><a id="__codelineno-0-1030" name="__codelineno-0-1030"></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="bp">self</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_parent_list</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-1031"><a id="__codelineno-0-1031" name="__codelineno-0-1031"></a> <span class="p">):</span>
|
||
|
</span><span id="__span-0-1032"><a id="__codelineno-0-1032" name="__codelineno-0-1032"></a> <span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s2">"Loop in folder tree"</span><span class="p">),</span> <span class="n">code</span><span class="o">=</span><span class="s2">"loop"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1033"><a id="__codelineno-0-1033" name="__codelineno-0-1033"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">is_file</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1034"><a id="__codelineno-0-1034" name="__codelineno-0-1034"></a> <span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-1035"><a id="__codelineno-0-1035" name="__codelineno-0-1035"></a> <span class="n">_</span><span class="p">(</span><span class="s2">"You can not make a file be a children of a non folder file"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1036"><a id="__codelineno-0-1036" name="__codelineno-0-1036"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-1037"><a id="__codelineno-0-1037" name="__codelineno-0-1037"></a> <span class="k">if</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-1038"><a id="__codelineno-0-1038" name="__codelineno-0-1038"></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="ow">is</span> <span class="kc">None</span>
|
||
|
</span><span id="__span-0-1039"><a id="__codelineno-0-1039" name="__codelineno-0-1039"></a> <span class="ow">and</span> <span class="n">SithFile</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">exclude</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1040"><a id="__codelineno-0-1040" name="__codelineno-0-1040"></a> <span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1041"><a id="__codelineno-0-1041" name="__codelineno-0-1041"></a> <span class="o">.</span><span class="n">exists</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-1042"><a id="__codelineno-0-1042" name="__codelineno-0-1042"></a> <span class="p">)</span> <span class="ow">or</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-1043"><a id="__codelineno-0-1043" name="__codelineno-0-1043"></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span>
|
||
|
</span><span id="__span-0-1044"><a id="__codelineno-0-1044" name="__codelineno-0-1044"></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">children</span><span class="o">.</span><span class="n">exclude</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span><span class="o">.</span><span class="n">exists</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-1045"><a id="__codelineno-0-1045" name="__codelineno-0-1045"></a> <span class="p">):</span>
|
||
|
</span><span id="__span-0-1046"><a id="__codelineno-0-1046" name="__codelineno-0-1046"></a> <span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s2">"Duplicate file"</span><span class="p">),</span> <span class="n">code</span><span class="o">=</span><span class="s2">"duplicate"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1047"><a id="__codelineno-0-1047" name="__codelineno-0-1047"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_folder</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1048"><a id="__codelineno-0-1048" name="__codelineno-0-1048"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">file</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1049"><a id="__codelineno-0-1049" name="__codelineno-0-1049"></a> <span class="k">try</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1050"><a id="__codelineno-0-1050" name="__codelineno-0-1050"></a> <span class="kn">import</span> <span class="nn">imghdr</span>
|
||
|
</span><span id="__span-0-1051"><a id="__codelineno-0-1051" name="__codelineno-0-1051"></a>
|
||
|
</span><span id="__span-0-1052"><a id="__codelineno-0-1052" name="__codelineno-0-1052"></a> <span class="k">if</span> <span class="n">imghdr</span><span class="o">.</span><span class="n">what</span><span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">file</span><span class="o">.</span><span class="n">read</span><span class="p">())</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span>
|
||
|
</span><span id="__span-0-1053"><a id="__codelineno-0-1053" name="__codelineno-0-1053"></a> <span class="s2">"gif"</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-1054"><a id="__codelineno-0-1054" name="__codelineno-0-1054"></a> <span class="s2">"png"</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-1055"><a id="__codelineno-0-1055" name="__codelineno-0-1055"></a> <span class="s2">"jpeg"</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-1056"><a id="__codelineno-0-1056" name="__codelineno-0-1056"></a> <span class="p">]:</span>
|
||
|
</span><span id="__span-0-1057"><a id="__codelineno-0-1057" name="__codelineno-0-1057"></a> <span class="bp">self</span><span class="o">.</span><span class="n">file</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-1058"><a id="__codelineno-0-1058" name="__codelineno-0-1058"></a> <span class="bp">self</span><span class="o">.</span><span class="n">file</span> <span class="o">=</span> <span class="kc">None</span>
|
||
|
</span><span id="__span-0-1059"><a id="__codelineno-0-1059" name="__codelineno-0-1059"></a> <span class="k">except</span><span class="p">:</span> <span class="c1"># noqa E722 I don't know the exception that can be raised</span>
|
||
|
</span><span id="__span-0-1060"><a id="__codelineno-0-1060" name="__codelineno-0-1060"></a> <span class="bp">self</span><span class="o">.</span><span class="n">file</span> <span class="o">=</span> <span class="kc">None</span>
|
||
|
</span><span id="__span-0-1061"><a id="__codelineno-0-1061" name="__codelineno-0-1061"></a> <span class="bp">self</span><span class="o">.</span><span class="n">mime_type</span> <span class="o">=</span> <span class="s2">"inode/directory"</span>
|
||
|
</span><span id="__span-0-1062"><a id="__codelineno-0-1062" name="__codelineno-0-1062"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_file</span> <span class="ow">and</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">file</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">file</span> <span class="o">==</span> <span class="s2">""</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-1063"><a id="__codelineno-0-1063" name="__codelineno-0-1063"></a> <span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s2">"You must provide a file"</span><span class="p">))</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.SithFile.apply_rights_recursively" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">apply_rights_recursively</span><span class="p">(</span><span class="o">*</span><span class="p">,</span> <span class="n">only_folders</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.SithFile.apply_rights_recursively" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Apply the rights of this file to all children recursively.</p>
|
||
|
|
||
|
|
||
|
<p><span class="doc-section-title">Parameters:</span></p>
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Name</th>
|
||
|
<th>Type</th>
|
||
|
<th>Description</th>
|
||
|
<th>Default</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>only_folders</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>bool</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>If True, only apply the rights to SithFiles that are folders.</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>False</code>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1065">1065</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1066">1066</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1067">1067</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1068">1068</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1069">1069</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1070">1070</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1071">1071</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1072">1072</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1073">1073</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1074">1074</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1075">1075</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1076">1076</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1077">1077</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1078">1078</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1079">1079</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1080">1080</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1081">1081</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1082">1082</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1083">1083</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1084">1084</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1085">1085</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1086">1086</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1087">1087</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1088">1088</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1089">1089</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1090">1090</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1065"><a id="__codelineno-0-1065" name="__codelineno-0-1065"></a><span class="k">def</span> <span class="nf">apply_rights_recursively</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">only_folders</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1066"><a id="__codelineno-0-1066" name="__codelineno-0-1066"></a><span class="w"> </span><span class="sd">"""Apply the rights of this file to all children recursively.</span>
|
||
|
</span><span id="__span-0-1067"><a id="__codelineno-0-1067" name="__codelineno-0-1067"></a>
|
||
|
</span><span id="__span-0-1068"><a id="__codelineno-0-1068" name="__codelineno-0-1068"></a><span class="sd"> Args:</span>
|
||
|
</span><span id="__span-0-1069"><a id="__codelineno-0-1069" name="__codelineno-0-1069"></a><span class="sd"> only_folders: If True, only apply the rights to SithFiles that are folders.</span>
|
||
|
</span><span id="__span-0-1070"><a id="__codelineno-0-1070" name="__codelineno-0-1070"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-1071"><a id="__codelineno-0-1071" name="__codelineno-0-1071"></a> <span class="n">file_ids</span> <span class="o">=</span> <span class="p">[]</span>
|
||
|
</span><span id="__span-0-1072"><a id="__codelineno-0-1072" name="__codelineno-0-1072"></a> <span class="n">explored_ids</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">]</span>
|
||
|
</span><span id="__span-0-1073"><a id="__codelineno-0-1073" name="__codelineno-0-1073"></a> <span class="k">while</span> <span class="nb">len</span><span class="p">(</span><span class="n">explored_ids</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> <span class="c1"># find all children recursively</span>
|
||
|
</span><span id="__span-0-1074"><a id="__codelineno-0-1074" name="__codelineno-0-1074"></a> <span class="n">file_ids</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">explored_ids</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1075"><a id="__codelineno-0-1075" name="__codelineno-0-1075"></a> <span class="n">next_level</span> <span class="o">=</span> <span class="n">SithFile</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">parent_id__in</span><span class="o">=</span><span class="n">explored_ids</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1076"><a id="__codelineno-0-1076" name="__codelineno-0-1076"></a> <span class="k">if</span> <span class="n">only_folders</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1077"><a id="__codelineno-0-1077" name="__codelineno-0-1077"></a> <span class="n">next_level</span> <span class="o">=</span> <span class="n">next_level</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">is_folder</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-1078"><a id="__codelineno-0-1078" name="__codelineno-0-1078"></a> <span class="n">explored_ids</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">next_level</span><span class="o">.</span><span class="n">values_list</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
|
||
|
</span><span id="__span-0-1079"><a id="__codelineno-0-1079" name="__codelineno-0-1079"></a> <span class="k">for</span> <span class="n">through</span> <span class="ow">in</span> <span class="p">(</span><span class="n">SithFile</span><span class="o">.</span><span class="n">view_groups</span><span class="o">.</span><span class="n">through</span><span class="p">,</span> <span class="n">SithFile</span><span class="o">.</span><span class="n">edit_groups</span><span class="o">.</span><span class="n">through</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-1080"><a id="__codelineno-0-1080" name="__codelineno-0-1080"></a> <span class="c1"># force evaluation. Without this, the iterator yields nothing</span>
|
||
|
</span><span id="__span-0-1081"><a id="__codelineno-0-1081" name="__codelineno-0-1081"></a> <span class="n">groups</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-1082"><a id="__codelineno-0-1082" name="__codelineno-0-1082"></a> <span class="n">through</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">sithfile_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">)</span><span class="o">.</span><span class="n">values_list</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-1083"><a id="__codelineno-0-1083" name="__codelineno-0-1083"></a> <span class="s2">"group_id"</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span>
|
||
|
</span><span id="__span-0-1084"><a id="__codelineno-0-1084" name="__codelineno-0-1084"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-1085"><a id="__codelineno-0-1085" name="__codelineno-0-1085"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-1086"><a id="__codelineno-0-1086" name="__codelineno-0-1086"></a> <span class="c1"># delete previous rights</span>
|
||
|
</span><span id="__span-0-1087"><a id="__codelineno-0-1087" name="__codelineno-0-1087"></a> <span class="n">through</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">sithfile_id__in</span><span class="o">=</span><span class="n">file_ids</span><span class="p">)</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-1088"><a id="__codelineno-0-1088" name="__codelineno-0-1088"></a> <span class="n">through</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">bulk_create</span><span class="p">(</span> <span class="c1"># create new rights</span>
|
||
|
</span><span id="__span-0-1089"><a id="__codelineno-0-1089" name="__codelineno-0-1089"></a> <span class="p">[</span><span class="n">through</span><span class="p">(</span><span class="n">sithfile_id</span><span class="o">=</span><span class="n">f</span><span class="p">,</span> <span class="n">group_id</span><span class="o">=</span><span class="n">g</span><span class="p">)</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">file_ids</span> <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">]</span>
|
||
|
</span><span id="__span-0-1090"><a id="__codelineno-0-1090" name="__codelineno-0-1090"></a> <span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.SithFile.copy_rights" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">copy_rights</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.SithFile.copy_rights" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Copy, if possible, the rights of the parent folder.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1092">1092</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1093">1093</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1094">1094</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1095">1095</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1096">1096</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1092"><a id="__codelineno-0-1092" name="__codelineno-0-1092"></a><span class="k">def</span> <span class="nf">copy_rights</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-1093"><a id="__codelineno-0-1093" name="__codelineno-0-1093"></a><span class="w"> </span><span class="sd">"""Copy, if possible, the rights of the parent folder."""</span>
|
||
|
</span><span id="__span-0-1094"><a id="__codelineno-0-1094" name="__codelineno-0-1094"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1095"><a id="__codelineno-0-1095" name="__codelineno-0-1095"></a> <span class="bp">self</span><span class="o">.</span><span class="n">edit_groups</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">edit_groups</span><span class="o">.</span><span class="n">all</span><span class="p">())</span>
|
||
|
</span><span id="__span-0-1096"><a id="__codelineno-0-1096" name="__codelineno-0-1096"></a> <span class="bp">self</span><span class="o">.</span><span class="n">view_groups</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">view_groups</span><span class="o">.</span><span class="n">all</span><span class="p">())</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.SithFile.move_to" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">move_to</span><span class="p">(</span><span class="n">parent</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.SithFile.move_to" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Move a file to a new parent.
|
||
|
<code>parent</code> must be a SithFile with the <code>is_folder=True</code> property. Otherwise, this function doesn't change
|
||
|
anything.
|
||
|
This is done only at the DB level, so that it's very fast for the user. Indeed, this function doesn't modify
|
||
|
SithFiles recursively, so it stays efficient even with top-level folders.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1098">1098</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1099">1099</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1100">1100</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1101">1101</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1102">1102</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1103">1103</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1104">1104</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1105">1105</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1106">1106</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1107">1107</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1108">1108</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-1109">1109</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1098"><a id="__codelineno-0-1098" name="__codelineno-0-1098"></a><span class="k">def</span> <span class="nf">move_to</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-1099"><a id="__codelineno-0-1099" name="__codelineno-0-1099"></a><span class="w"> </span><span class="sd">"""Move a file to a new parent.</span>
|
||
|
</span><span id="__span-0-1100"><a id="__codelineno-0-1100" name="__codelineno-0-1100"></a><span class="sd"> `parent` must be a SithFile with the `is_folder=True` property. Otherwise, this function doesn't change</span>
|
||
|
</span><span id="__span-0-1101"><a id="__codelineno-0-1101" name="__codelineno-0-1101"></a><span class="sd"> anything.</span>
|
||
|
</span><span id="__span-0-1102"><a id="__codelineno-0-1102" name="__codelineno-0-1102"></a><span class="sd"> This is done only at the DB level, so that it's very fast for the user. Indeed, this function doesn't modify</span>
|
||
|
</span><span id="__span-0-1103"><a id="__codelineno-0-1103" name="__codelineno-0-1103"></a><span class="sd"> SithFiles recursively, so it stays efficient even with top-level folders.</span>
|
||
|
</span><span id="__span-0-1104"><a id="__codelineno-0-1104" name="__codelineno-0-1104"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-1105"><a id="__codelineno-0-1105" name="__codelineno-0-1105"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">parent</span><span class="o">.</span><span class="n">is_folder</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-1106"><a id="__codelineno-0-1106" name="__codelineno-0-1106"></a> <span class="k">return</span>
|
||
|
</span><span id="__span-0-1107"><a id="__codelineno-0-1107" name="__codelineno-0-1107"></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
|
||
|
</span><span id="__span-0-1108"><a id="__codelineno-0-1108" name="__codelineno-0-1108"></a> <span class="bp">self</span><span class="o">.</span><span class="n">clean</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-1109"><a id="__codelineno-0-1109" name="__codelineno-0-1109"></a> <span class="bp">self</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.User" class="doc doc-heading">
|
||
|
<code>User</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.User" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>AbstractBaseUser</code></p>
|
||
|
|
||
|
|
||
|
<p>Defines the base user class, useable in every app.</p>
|
||
|
<p>This is almost the same as the auth module AbstractUser since it inherits from it,
|
||
|
but some fields are required, and the username is generated automatically with the
|
||
|
name of the user (see generate_username()).</p>
|
||
|
<p>Added field: nick_name, date_of_birth
|
||
|
Required fields: email, first_name, last_name, date_of_birth</p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-object doc-attribute">
|
||
|
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.cached_groups" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">cached_groups</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">Group</span><span class="p">]</span></code>
|
||
|
|
||
|
<span class="doc doc-labels">
|
||
|
<small class="doc doc-label doc-label-property"><code>property</code></small>
|
||
|
</span>
|
||
|
|
||
|
<a href="#rootplace.views.User.cached_groups" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Get the list of groups this user is in.</p>
|
||
|
<p>The result is cached for the default duration (should be 5 minutes)</p>
|
||
|
<p>Returns: A list of all the groups this user is in.</p>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.is_in_group" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">is_in_group</span><span class="p">(</span><span class="o">*</span><span class="p">,</span> <span class="n">pk</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.is_in_group" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Check if this user is in the given group.
|
||
|
Either a group id or a group name must be provided.
|
||
|
If both are passed, only the id will be considered.</p>
|
||
|
<p>The group will be fetched using the given parameter.
|
||
|
If no group is found, return False.
|
||
|
If a group is found, check if this user is in the latter.</p>
|
||
|
|
||
|
|
||
|
<p><span class="doc-section-title">Returns:</span></p>
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Type</th>
|
||
|
<th>Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>bool</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>True if the user is the group, else False</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-448">448</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-449">449</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-450">450</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-451">451</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-452">452</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-453">453</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-454">454</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-455">455</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-456">456</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-457">457</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-458">458</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-459">459</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-460">460</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-461">461</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-462">462</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-463">463</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-464">464</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-465">465</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-466">466</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-467">467</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-468">468</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-469">469</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-470">470</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-471">471</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-472">472</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-473">473</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-474">474</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-475">475</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-476">476</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-477">477</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-478">478</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-479">479</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-480">480</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-481">481</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-482">482</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-483">483</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-484">484</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-485">485</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-486">486</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-487">487</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-488">488</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-448"><a id="__codelineno-0-448" name="__codelineno-0-448"></a><span class="k">def</span> <span class="nf">is_in_group</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">pk</span><span class="p">:</span> <span class="nb">int</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-449"><a id="__codelineno-0-449" name="__codelineno-0-449"></a><span class="w"> </span><span class="sd">"""Check if this user is in the given group.</span>
|
||
|
</span><span id="__span-0-450"><a id="__codelineno-0-450" name="__codelineno-0-450"></a><span class="sd"> Either a group id or a group name must be provided.</span>
|
||
|
</span><span id="__span-0-451"><a id="__codelineno-0-451" name="__codelineno-0-451"></a><span class="sd"> If both are passed, only the id will be considered.</span>
|
||
|
</span><span id="__span-0-452"><a id="__codelineno-0-452" name="__codelineno-0-452"></a>
|
||
|
</span><span id="__span-0-453"><a id="__codelineno-0-453" name="__codelineno-0-453"></a><span class="sd"> The group will be fetched using the given parameter.</span>
|
||
|
</span><span id="__span-0-454"><a id="__codelineno-0-454" name="__codelineno-0-454"></a><span class="sd"> If no group is found, return False.</span>
|
||
|
</span><span id="__span-0-455"><a id="__codelineno-0-455" name="__codelineno-0-455"></a><span class="sd"> If a group is found, check if this user is in the latter.</span>
|
||
|
</span><span id="__span-0-456"><a id="__codelineno-0-456" name="__codelineno-0-456"></a>
|
||
|
</span><span id="__span-0-457"><a id="__codelineno-0-457" name="__codelineno-0-457"></a><span class="sd"> Returns:</span>
|
||
|
</span><span id="__span-0-458"><a id="__codelineno-0-458" name="__codelineno-0-458"></a><span class="sd"> True if the user is the group, else False</span>
|
||
|
</span><span id="__span-0-459"><a id="__codelineno-0-459" name="__codelineno-0-459"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-460"><a id="__codelineno-0-460" name="__codelineno-0-460"></a> <span class="k">if</span> <span class="n">pk</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-461"><a id="__codelineno-0-461" name="__codelineno-0-461"></a> <span class="n">group</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Group</span><span class="p">]</span> <span class="o">=</span> <span class="n">get_group</span><span class="p">(</span><span class="n">pk</span><span class="o">=</span><span class="n">pk</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-462"><a id="__codelineno-0-462" name="__codelineno-0-462"></a> <span class="k">elif</span> <span class="n">name</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-463"><a id="__codelineno-0-463" name="__codelineno-0-463"></a> <span class="n">group</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Group</span><span class="p">]</span> <span class="o">=</span> <span class="n">get_group</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-464"><a id="__codelineno-0-464" name="__codelineno-0-464"></a> <span class="k">else</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-465"><a id="__codelineno-0-465" name="__codelineno-0-465"></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"You must either provide the id or the name of the group"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-466"><a id="__codelineno-0-466" name="__codelineno-0-466"></a> <span class="k">if</span> <span class="n">group</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-467"><a id="__codelineno-0-467" name="__codelineno-0-467"></a> <span class="k">return</span> <span class="kc">False</span>
|
||
|
</span><span id="__span-0-468"><a id="__codelineno-0-468" name="__codelineno-0-468"></a> <span class="k">if</span> <span class="n">group</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">SITH_GROUP_PUBLIC_ID</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-469"><a id="__codelineno-0-469" name="__codelineno-0-469"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-470"><a id="__codelineno-0-470" name="__codelineno-0-470"></a> <span class="k">if</span> <span class="n">group</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">SITH_GROUP_SUBSCRIBERS_ID</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-471"><a id="__codelineno-0-471" name="__codelineno-0-471"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_subscribed</span>
|
||
|
</span><span id="__span-0-472"><a id="__codelineno-0-472" name="__codelineno-0-472"></a> <span class="k">if</span> <span class="n">group</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">SITH_GROUP_OLD_SUBSCRIBERS_ID</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-473"><a id="__codelineno-0-473" name="__codelineno-0-473"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">was_subscribed</span>
|
||
|
</span><span id="__span-0-474"><a id="__codelineno-0-474" name="__codelineno-0-474"></a> <span class="k">if</span> <span class="n">group</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">SITH_GROUP_ROOT_ID</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-475"><a id="__codelineno-0-475" name="__codelineno-0-475"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_root</span>
|
||
|
</span><span id="__span-0-476"><a id="__codelineno-0-476" name="__codelineno-0-476"></a> <span class="k">if</span> <span class="n">group</span><span class="o">.</span><span class="n">is_meta</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-477"><a id="__codelineno-0-477" name="__codelineno-0-477"></a> <span class="c1"># check if this group is associated with a club</span>
|
||
|
</span><span id="__span-0-478"><a id="__codelineno-0-478" name="__codelineno-0-478"></a> <span class="n">group</span><span class="o">.</span><span class="vm">__class__</span> <span class="o">=</span> <span class="n">MetaGroup</span>
|
||
|
</span><span id="__span-0-479"><a id="__codelineno-0-479" name="__codelineno-0-479"></a> <span class="n">club</span> <span class="o">=</span> <span class="n">group</span><span class="o">.</span><span class="n">associated_club</span>
|
||
|
</span><span id="__span-0-480"><a id="__codelineno-0-480" name="__codelineno-0-480"></a> <span class="k">if</span> <span class="n">club</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-481"><a id="__codelineno-0-481" name="__codelineno-0-481"></a> <span class="k">return</span> <span class="kc">False</span>
|
||
|
</span><span id="__span-0-482"><a id="__codelineno-0-482" name="__codelineno-0-482"></a> <span class="n">membership</span> <span class="o">=</span> <span class="n">club</span><span class="o">.</span><span class="n">get_membership_for</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-483"><a id="__codelineno-0-483" name="__codelineno-0-483"></a> <span class="k">if</span> <span class="n">membership</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-484"><a id="__codelineno-0-484" name="__codelineno-0-484"></a> <span class="k">return</span> <span class="kc">False</span>
|
||
|
</span><span id="__span-0-485"><a id="__codelineno-0-485" name="__codelineno-0-485"></a> <span class="k">if</span> <span class="n">group</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">SITH_MEMBER_SUFFIX</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-486"><a id="__codelineno-0-486" name="__codelineno-0-486"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-487"><a id="__codelineno-0-487" name="__codelineno-0-487"></a> <span class="k">return</span> <span class="n">membership</span><span class="o">.</span><span class="n">role</span> <span class="o">></span> <span class="n">settings</span><span class="o">.</span><span class="n">SITH_MAXIMUM_FREE_ROLE</span>
|
||
|
</span><span id="__span-0-488"><a id="__codelineno-0-488" name="__codelineno-0-488"></a> <span class="k">return</span> <span class="n">group</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cached_groups</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.age" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">age</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.age" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Return the age this user has the day the method is called.
|
||
|
If the user has not filled his age, return 0.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-559">559</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-560">560</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-561">561</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-562">562</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-563">563</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-564">564</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-565">565</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-566">566</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-567">567</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-568">568</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-569">569</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-570">570</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-571">571</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-572">572</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-573">573</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-559"><a id="__codelineno-0-559" name="__codelineno-0-559"></a><span class="nd">@cached_property</span>
|
||
|
</span><span id="__span-0-560"><a id="__codelineno-0-560" name="__codelineno-0-560"></a><span class="k">def</span> <span class="nf">age</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-561"><a id="__codelineno-0-561" name="__codelineno-0-561"></a><span class="w"> </span><span class="sd">"""Return the age this user has the day the method is called.</span>
|
||
|
</span><span id="__span-0-562"><a id="__codelineno-0-562" name="__codelineno-0-562"></a><span class="sd"> If the user has not filled his age, return 0.</span>
|
||
|
</span><span id="__span-0-563"><a id="__codelineno-0-563" name="__codelineno-0-563"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-564"><a id="__codelineno-0-564" name="__codelineno-0-564"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">date_of_birth</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-565"><a id="__codelineno-0-565" name="__codelineno-0-565"></a> <span class="k">return</span> <span class="mi">0</span>
|
||
|
</span><span id="__span-0-566"><a id="__codelineno-0-566" name="__codelineno-0-566"></a> <span class="n">today</span> <span class="o">=</span> <span class="n">timezone</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-567"><a id="__codelineno-0-567" name="__codelineno-0-567"></a> <span class="n">age</span> <span class="o">=</span> <span class="n">today</span><span class="o">.</span><span class="n">year</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">date_of_birth</span><span class="o">.</span><span class="n">year</span>
|
||
|
</span><span id="__span-0-568"><a id="__codelineno-0-568" name="__codelineno-0-568"></a> <span class="c1"># remove a year if this year's birthday is yet to come</span>
|
||
|
</span><span id="__span-0-569"><a id="__codelineno-0-569" name="__codelineno-0-569"></a> <span class="n">age</span> <span class="o">-=</span> <span class="p">(</span><span class="n">today</span><span class="o">.</span><span class="n">month</span><span class="p">,</span> <span class="n">today</span><span class="o">.</span><span class="n">day</span><span class="p">)</span> <span class="o"><</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-570"><a id="__codelineno-0-570" name="__codelineno-0-570"></a> <span class="bp">self</span><span class="o">.</span><span class="n">date_of_birth</span><span class="o">.</span><span class="n">month</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-571"><a id="__codelineno-0-571" name="__codelineno-0-571"></a> <span class="bp">self</span><span class="o">.</span><span class="n">date_of_birth</span><span class="o">.</span><span class="n">day</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-572"><a id="__codelineno-0-572" name="__codelineno-0-572"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-573"><a id="__codelineno-0-573" name="__codelineno-0-573"></a> <span class="k">return</span> <span class="n">age</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.get_full_name" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">get_full_name</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.get_full_name" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Returns the first_name plus the last_name, with a space in between.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-601">601</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-602">602</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-603">603</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-604">604</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-601"><a id="__codelineno-0-601" name="__codelineno-0-601"></a><span class="k">def</span> <span class="nf">get_full_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-602"><a id="__codelineno-0-602" name="__codelineno-0-602"></a><span class="w"> </span><span class="sd">"""Returns the first_name plus the last_name, with a space in between."""</span>
|
||
|
</span><span id="__span-0-603"><a id="__codelineno-0-603" name="__codelineno-0-603"></a> <span class="n">full_name</span> <span class="o">=</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">first_name</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">last_name</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-604"><a id="__codelineno-0-604" name="__codelineno-0-604"></a> <span class="k">return</span> <span class="n">full_name</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.get_short_name" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">get_short_name</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.get_short_name" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Returns the short name for the user.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-606">606</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-607">607</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-608">608</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-609">609</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-610">610</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-606"><a id="__codelineno-0-606" name="__codelineno-0-606"></a><span class="k">def</span> <span class="nf">get_short_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-607"><a id="__codelineno-0-607" name="__codelineno-0-607"></a><span class="w"> </span><span class="sd">"""Returns the short name for the user."""</span>
|
||
|
</span><span id="__span-0-608"><a id="__codelineno-0-608" name="__codelineno-0-608"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">nick_name</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-609"><a id="__codelineno-0-609" name="__codelineno-0-609"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">nick_name</span>
|
||
|
</span><span id="__span-0-610"><a id="__codelineno-0-610" name="__codelineno-0-610"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">first_name</span> <span class="o">+</span> <span class="s2">" "</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">last_name</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.get_display_name" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">get_display_name</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.get_display_name" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Returns the display name of the user.</p>
|
||
|
<p>A nickname if possible, otherwise, the full name.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-612">612</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-613">613</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-614">614</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-615">615</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-616">616</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-617">617</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-618">618</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-619">619</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-612"><a id="__codelineno-0-612" name="__codelineno-0-612"></a><span class="k">def</span> <span class="nf">get_display_name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-613"><a id="__codelineno-0-613" name="__codelineno-0-613"></a><span class="w"> </span><span class="sd">"""Returns the display name of the user.</span>
|
||
|
</span><span id="__span-0-614"><a id="__codelineno-0-614" name="__codelineno-0-614"></a>
|
||
|
</span><span id="__span-0-615"><a id="__codelineno-0-615" name="__codelineno-0-615"></a><span class="sd"> A nickname if possible, otherwise, the full name.</span>
|
||
|
</span><span id="__span-0-616"><a id="__codelineno-0-616" name="__codelineno-0-616"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-617"><a id="__codelineno-0-617" name="__codelineno-0-617"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">nick_name</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-618"><a id="__codelineno-0-618" name="__codelineno-0-618"></a> <span class="k">return</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> (</span><span class="si">%s</span><span class="s2">)"</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_full_name</span><span class="p">(),</span> <span class="bp">self</span><span class="o">.</span><span class="n">nick_name</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-619"><a id="__codelineno-0-619" name="__codelineno-0-619"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_full_name</span><span class="p">()</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.get_age" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">get_age</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.get_age" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Returns the age.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-621">621</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-622">622</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-623">623</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-624">624</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-625">625</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-626">626</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-627">627</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-621"><a id="__codelineno-0-621" name="__codelineno-0-621"></a><span class="k">def</span> <span class="nf">get_age</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-622"><a id="__codelineno-0-622" name="__codelineno-0-622"></a><span class="w"> </span><span class="sd">"""Returns the age."""</span>
|
||
|
</span><span id="__span-0-623"><a id="__codelineno-0-623" name="__codelineno-0-623"></a> <span class="n">today</span> <span class="o">=</span> <span class="n">timezone</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-624"><a id="__codelineno-0-624" name="__codelineno-0-624"></a> <span class="n">born</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">date_of_birth</span>
|
||
|
</span><span id="__span-0-625"><a id="__codelineno-0-625" name="__codelineno-0-625"></a> <span class="k">return</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-626"><a id="__codelineno-0-626" name="__codelineno-0-626"></a> <span class="n">today</span><span class="o">.</span><span class="n">year</span> <span class="o">-</span> <span class="n">born</span><span class="o">.</span><span class="n">year</span> <span class="o">-</span> <span class="p">((</span><span class="n">today</span><span class="o">.</span><span class="n">month</span><span class="p">,</span> <span class="n">today</span><span class="o">.</span><span class="n">day</span><span class="p">)</span> <span class="o"><</span> <span class="p">(</span><span class="n">born</span><span class="o">.</span><span class="n">month</span><span class="p">,</span> <span class="n">born</span><span class="o">.</span><span class="n">day</span><span class="p">))</span>
|
||
|
</span><span id="__span-0-627"><a id="__codelineno-0-627" name="__codelineno-0-627"></a> <span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.get_family" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">get_family</span><span class="p">(</span><span class="n">godfathers_depth</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">godchildren_depth</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.get_family" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Get the family of the user, with the given depth.</p>
|
||
|
|
||
|
|
||
|
<p><span class="doc-section-title">Parameters:</span></p>
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Name</th>
|
||
|
<th>Type</th>
|
||
|
<th>Description</th>
|
||
|
<th>Default</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>godfathers_depth</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>NonNegativeInt</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>The number of generations of godfathers to fetch</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>4</code>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>godchildren_depth</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>NonNegativeInt</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>The number of generations of godchildren to fetch</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>4</code>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
<p><span class="doc-section-title">Returns:</span></p>
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Type</th>
|
||
|
<th>Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>set[through]</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>A list of family relationships in this user's family</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-629">629</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-630">630</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-631">631</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-632">632</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-633">633</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-634">634</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-635">635</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-636">636</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-637">637</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-638">638</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-639">639</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-640">640</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-641">641</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-642">642</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-643">643</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-644">644</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-645">645</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-646">646</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-647">647</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-648">648</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-649">649</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-650">650</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-651">651</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-652">652</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-653">653</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-654">654</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-655">655</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-656">656</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-657">657</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-658">658</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-659">659</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-660">660</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-661">661</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-662">662</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-629"><a id="__codelineno-0-629" name="__codelineno-0-629"></a><span class="k">def</span> <span class="nf">get_family</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-630"><a id="__codelineno-0-630" name="__codelineno-0-630"></a> <span class="bp">self</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-631"><a id="__codelineno-0-631" name="__codelineno-0-631"></a> <span class="n">godfathers_depth</span><span class="p">:</span> <span class="n">NonNegativeInt</span> <span class="o">=</span> <span class="mi">4</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-632"><a id="__codelineno-0-632" name="__codelineno-0-632"></a> <span class="n">godchildren_depth</span><span class="p">:</span> <span class="n">NonNegativeInt</span> <span class="o">=</span> <span class="mi">4</span><span class="p">,</span>
|
||
|
</span><span id="__span-0-633"><a id="__codelineno-0-633" name="__codelineno-0-633"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">set</span><span class="p">[</span><span class="n">User</span><span class="o">.</span><span class="n">godfathers</span><span class="o">.</span><span class="n">through</span><span class="p">]:</span>
|
||
|
</span><span id="__span-0-634"><a id="__codelineno-0-634" name="__codelineno-0-634"></a><span class="w"> </span><span class="sd">"""Get the family of the user, with the given depth.</span>
|
||
|
</span><span id="__span-0-635"><a id="__codelineno-0-635" name="__codelineno-0-635"></a>
|
||
|
</span><span id="__span-0-636"><a id="__codelineno-0-636" name="__codelineno-0-636"></a><span class="sd"> Args:</span>
|
||
|
</span><span id="__span-0-637"><a id="__codelineno-0-637" name="__codelineno-0-637"></a><span class="sd"> godfathers_depth: The number of generations of godfathers to fetch</span>
|
||
|
</span><span id="__span-0-638"><a id="__codelineno-0-638" name="__codelineno-0-638"></a><span class="sd"> godchildren_depth: The number of generations of godchildren to fetch</span>
|
||
|
</span><span id="__span-0-639"><a id="__codelineno-0-639" name="__codelineno-0-639"></a>
|
||
|
</span><span id="__span-0-640"><a id="__codelineno-0-640" name="__codelineno-0-640"></a><span class="sd"> Returns:</span>
|
||
|
</span><span id="__span-0-641"><a id="__codelineno-0-641" name="__codelineno-0-641"></a><span class="sd"> A list of family relationships in this user's family</span>
|
||
|
</span><span id="__span-0-642"><a id="__codelineno-0-642" name="__codelineno-0-642"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-643"><a id="__codelineno-0-643" name="__codelineno-0-643"></a> <span class="n">res</span> <span class="o">=</span> <span class="p">[]</span>
|
||
|
</span><span id="__span-0-644"><a id="__codelineno-0-644" name="__codelineno-0-644"></a> <span class="k">for</span> <span class="n">depth</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">reverse_key</span> <span class="ow">in</span> <span class="p">[</span>
|
||
|
</span><span id="__span-0-645"><a id="__codelineno-0-645" name="__codelineno-0-645"></a> <span class="p">(</span><span class="n">godfathers_depth</span><span class="p">,</span> <span class="s2">"from_user_id"</span><span class="p">,</span> <span class="s2">"to_user_id"</span><span class="p">),</span>
|
||
|
</span><span id="__span-0-646"><a id="__codelineno-0-646" name="__codelineno-0-646"></a> <span class="p">(</span><span class="n">godchildren_depth</span><span class="p">,</span> <span class="s2">"to_user_id"</span><span class="p">,</span> <span class="s2">"from_user_id"</span><span class="p">),</span>
|
||
|
</span><span id="__span-0-647"><a id="__codelineno-0-647" name="__codelineno-0-647"></a> <span class="p">]:</span>
|
||
|
</span><span id="__span-0-648"><a id="__codelineno-0-648" name="__codelineno-0-648"></a> <span class="k">if</span> <span class="n">depth</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-649"><a id="__codelineno-0-649" name="__codelineno-0-649"></a> <span class="k">continue</span>
|
||
|
</span><span id="__span-0-650"><a id="__codelineno-0-650" name="__codelineno-0-650"></a> <span class="n">links</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">User</span><span class="o">.</span><span class="n">godfathers</span><span class="o">.</span><span class="n">through</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">}))</span>
|
||
|
</span><span id="__span-0-651"><a id="__codelineno-0-651" name="__codelineno-0-651"></a> <span class="n">res</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">links</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-652"><a id="__codelineno-0-652" name="__codelineno-0-652"></a> <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">depth</span><span class="p">):</span> <span class="c1"># noqa: F402 we don't care about gettext here</span>
|
||
|
</span><span id="__span-0-653"><a id="__codelineno-0-653" name="__codelineno-0-653"></a> <span class="n">ids</span> <span class="o">=</span> <span class="p">[</span><span class="nb">getattr</span><span class="p">(</span><span class="n">c</span><span class="p">,</span> <span class="n">reverse_key</span><span class="p">)</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">links</span><span class="p">]</span>
|
||
|
</span><span id="__span-0-654"><a id="__codelineno-0-654" name="__codelineno-0-654"></a> <span class="n">links</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-655"><a id="__codelineno-0-655" name="__codelineno-0-655"></a> <span class="n">User</span><span class="o">.</span><span class="n">godfathers</span><span class="o">.</span><span class="n">through</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-656"><a id="__codelineno-0-656" name="__codelineno-0-656"></a> <span class="o">**</span><span class="p">{</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">key</span><span class="si">}</span><span class="s2">__in"</span><span class="p">:</span> <span class="n">ids</span><span class="p">}</span>
|
||
|
</span><span id="__span-0-657"><a id="__codelineno-0-657" name="__codelineno-0-657"></a> <span class="p">)</span><span class="o">.</span><span class="n">exclude</span><span class="p">(</span><span class="n">id__in</span><span class="o">=</span><span class="p">[</span><span class="n">r</span><span class="o">.</span><span class="n">id</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res</span><span class="p">])</span>
|
||
|
</span><span id="__span-0-658"><a id="__codelineno-0-658" name="__codelineno-0-658"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-659"><a id="__codelineno-0-659" name="__codelineno-0-659"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">links</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-660"><a id="__codelineno-0-660" name="__codelineno-0-660"></a> <span class="k">break</span>
|
||
|
</span><span id="__span-0-661"><a id="__codelineno-0-661" name="__codelineno-0-661"></a> <span class="n">res</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">links</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-662"><a id="__codelineno-0-662" name="__codelineno-0-662"></a> <span class="k">return</span> <span class="nb">set</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.email_user" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">email_user</span><span class="p">(</span><span class="n">subject</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="n">from_email</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.email_user" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Sends an email to this User.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-664">664</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-665">665</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-666">666</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-667">667</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-668">668</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-664"><a id="__codelineno-0-664" name="__codelineno-0-664"></a><span class="k">def</span> <span class="nf">email_user</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">subject</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="n">from_email</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-665"><a id="__codelineno-0-665" name="__codelineno-0-665"></a><span class="w"> </span><span class="sd">"""Sends an email to this User."""</span>
|
||
|
</span><span id="__span-0-666"><a id="__codelineno-0-666" name="__codelineno-0-666"></a> <span class="k">if</span> <span class="n">from_email</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-667"><a id="__codelineno-0-667" name="__codelineno-0-667"></a> <span class="n">from_email</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">DEFAULT_FROM_EMAIL</span>
|
||
|
</span><span id="__span-0-668"><a id="__codelineno-0-668" name="__codelineno-0-668"></a> <span class="n">send_mail</span><span class="p">(</span><span class="n">subject</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="n">from_email</span><span class="p">,</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">email</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.generate_username" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">generate_username</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.generate_username" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Generates a unique username based on the first and last names.</p>
|
||
|
<p>For example: Guy Carlier gives gcarlier, and gcarlier1 if the first one exists.</p>
|
||
|
|
||
|
|
||
|
<p><span class="doc-section-title">Returns:</span></p>
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Type</th>
|
||
|
<th>Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>str</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>The generated username.</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-670">670</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-671">671</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-672">672</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-673">673</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-674">674</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-675">675</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-676">676</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-677">677</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-678">678</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-679">679</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-680">680</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-681">681</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-682">682</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-683">683</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-684">684</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-685">685</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-686">686</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-687">687</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-688">688</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-689">689</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-690">690</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-691">691</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-692">692</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-693">693</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-694">694</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-695">695</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-696">696</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-697">697</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-698">698</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-670"><a id="__codelineno-0-670" name="__codelineno-0-670"></a><span class="k">def</span> <span class="nf">generate_username</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-671"><a id="__codelineno-0-671" name="__codelineno-0-671"></a><span class="w"> </span><span class="sd">"""Generates a unique username based on the first and last names.</span>
|
||
|
</span><span id="__span-0-672"><a id="__codelineno-0-672" name="__codelineno-0-672"></a>
|
||
|
</span><span id="__span-0-673"><a id="__codelineno-0-673" name="__codelineno-0-673"></a><span class="sd"> For example: Guy Carlier gives gcarlier, and gcarlier1 if the first one exists.</span>
|
||
|
</span><span id="__span-0-674"><a id="__codelineno-0-674" name="__codelineno-0-674"></a>
|
||
|
</span><span id="__span-0-675"><a id="__codelineno-0-675" name="__codelineno-0-675"></a><span class="sd"> Returns:</span>
|
||
|
</span><span id="__span-0-676"><a id="__codelineno-0-676" name="__codelineno-0-676"></a><span class="sd"> The generated username.</span>
|
||
|
</span><span id="__span-0-677"><a id="__codelineno-0-677" name="__codelineno-0-677"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-678"><a id="__codelineno-0-678" name="__codelineno-0-678"></a>
|
||
|
</span><span id="__span-0-679"><a id="__codelineno-0-679" name="__codelineno-0-679"></a> <span class="k">def</span> <span class="nf">remove_accents</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-680"><a id="__codelineno-0-680" name="__codelineno-0-680"></a> <span class="k">return</span> <span class="s2">""</span><span class="o">.</span><span class="n">join</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-681"><a id="__codelineno-0-681" name="__codelineno-0-681"></a> <span class="n">x</span>
|
||
|
</span><span id="__span-0-682"><a id="__codelineno-0-682" name="__codelineno-0-682"></a> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">unicodedata</span><span class="o">.</span><span class="n">normalize</span><span class="p">(</span><span class="s2">"NFKD"</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-683"><a id="__codelineno-0-683" name="__codelineno-0-683"></a> <span class="k">if</span> <span class="n">unicodedata</span><span class="o">.</span><span class="n">category</span><span class="p">(</span><span class="n">x</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"L"</span>
|
||
|
</span><span id="__span-0-684"><a id="__codelineno-0-684" name="__codelineno-0-684"></a> <span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-685"><a id="__codelineno-0-685" name="__codelineno-0-685"></a>
|
||
|
</span><span id="__span-0-686"><a id="__codelineno-0-686" name="__codelineno-0-686"></a> <span class="n">user_name</span> <span class="o">=</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-687"><a id="__codelineno-0-687" name="__codelineno-0-687"></a> <span class="n">remove_accents</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">first_name</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">last_name</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-688"><a id="__codelineno-0-688" name="__codelineno-0-688"></a> <span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s2">"ascii"</span><span class="p">,</span> <span class="s2">"ignore"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-689"><a id="__codelineno-0-689" name="__codelineno-0-689"></a> <span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-690"><a id="__codelineno-0-690" name="__codelineno-0-690"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-691"><a id="__codelineno-0-691" name="__codelineno-0-691"></a> <span class="n">un_set</span> <span class="o">=</span> <span class="p">[</span><span class="n">u</span><span class="o">.</span><span class="n">username</span> <span class="k">for</span> <span class="n">u</span> <span class="ow">in</span> <span class="n">User</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">all</span><span class="p">()]</span>
|
||
|
</span><span id="__span-0-692"><a id="__codelineno-0-692" name="__codelineno-0-692"></a> <span class="k">if</span> <span class="n">user_name</span> <span class="ow">in</span> <span class="n">un_set</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-693"><a id="__codelineno-0-693" name="__codelineno-0-693"></a> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span>
|
||
|
</span><span id="__span-0-694"><a id="__codelineno-0-694" name="__codelineno-0-694"></a> <span class="k">while</span> <span class="n">user_name</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="ow">in</span> <span class="n">un_set</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-695"><a id="__codelineno-0-695" name="__codelineno-0-695"></a> <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
|
||
|
</span><span id="__span-0-696"><a id="__codelineno-0-696" name="__codelineno-0-696"></a> <span class="n">user_name</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-697"><a id="__codelineno-0-697" name="__codelineno-0-697"></a> <span class="bp">self</span><span class="o">.</span><span class="n">username</span> <span class="o">=</span> <span class="n">user_name</span>
|
||
|
</span><span id="__span-0-698"><a id="__codelineno-0-698" name="__codelineno-0-698"></a> <span class="k">return</span> <span class="n">user_name</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.is_owner" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">is_owner</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.is_owner" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Determine if the object is owned by the user.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-700">700</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-701">701</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-702">702</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-703">703</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-704">704</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-705">705</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-706">706</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-700"><a id="__codelineno-0-700" name="__codelineno-0-700"></a><span class="k">def</span> <span class="nf">is_owner</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-701"><a id="__codelineno-0-701" name="__codelineno-0-701"></a><span class="w"> </span><span class="sd">"""Determine if the object is owned by the user."""</span>
|
||
|
</span><span id="__span-0-702"><a id="__codelineno-0-702" name="__codelineno-0-702"></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">"is_owned_by"</span><span class="p">)</span> <span class="ow">and</span> <span class="n">obj</span><span class="o">.</span><span class="n">is_owned_by</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-703"><a id="__codelineno-0-703" name="__codelineno-0-703"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-704"><a id="__codelineno-0-704" name="__codelineno-0-704"></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">"owner_group"</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_in_group</span><span class="p">(</span><span class="n">pk</span><span class="o">=</span><span class="n">obj</span><span class="o">.</span><span class="n">owner_group</span><span class="o">.</span><span class="n">id</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-705"><a id="__codelineno-0-705" name="__codelineno-0-705"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-706"><a id="__codelineno-0-706" name="__codelineno-0-706"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_root</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.can_edit" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">can_edit</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.can_edit" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Determine if the object can be edited by the user.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-708">708</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-709">709</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-710">710</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-711">711</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-712">712</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-713">713</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-714">714</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-715">715</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-716">716</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-717">717</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-718">718</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-708"><a id="__codelineno-0-708" name="__codelineno-0-708"></a><span class="k">def</span> <span class="nf">can_edit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-709"><a id="__codelineno-0-709" name="__codelineno-0-709"></a><span class="w"> </span><span class="sd">"""Determine if the object can be edited by the user."""</span>
|
||
|
</span><span id="__span-0-710"><a id="__codelineno-0-710" name="__codelineno-0-710"></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">"can_be_edited_by"</span><span class="p">)</span> <span class="ow">and</span> <span class="n">obj</span><span class="o">.</span><span class="n">can_be_edited_by</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-711"><a id="__codelineno-0-711" name="__codelineno-0-711"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-712"><a id="__codelineno-0-712" name="__codelineno-0-712"></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">"edit_groups"</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-713"><a id="__codelineno-0-713" name="__codelineno-0-713"></a> <span class="k">for</span> <span class="n">pk</span> <span class="ow">in</span> <span class="n">obj</span><span class="o">.</span><span class="n">edit_groups</span><span class="o">.</span><span class="n">values_list</span><span class="p">(</span><span class="s2">"pk"</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-714"><a id="__codelineno-0-714" name="__codelineno-0-714"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_in_group</span><span class="p">(</span><span class="n">pk</span><span class="o">=</span><span class="n">pk</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-715"><a id="__codelineno-0-715" name="__codelineno-0-715"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-716"><a id="__codelineno-0-716" name="__codelineno-0-716"></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">User</span><span class="p">)</span> <span class="ow">and</span> <span class="n">obj</span> <span class="o">==</span> <span class="bp">self</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-717"><a id="__codelineno-0-717" name="__codelineno-0-717"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-718"><a id="__codelineno-0-718" name="__codelineno-0-718"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_owner</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.can_view" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">can_view</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.can_view" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Determine if the object can be viewed by the user.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-720">720</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-721">721</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-722">722</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-723">723</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-724">724</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-725">725</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-726">726</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-727">727</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-728">728</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-720"><a id="__codelineno-0-720" name="__codelineno-0-720"></a><span class="k">def</span> <span class="nf">can_view</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-721"><a id="__codelineno-0-721" name="__codelineno-0-721"></a><span class="w"> </span><span class="sd">"""Determine if the object can be viewed by the user."""</span>
|
||
|
</span><span id="__span-0-722"><a id="__codelineno-0-722" name="__codelineno-0-722"></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">"can_be_viewed_by"</span><span class="p">)</span> <span class="ow">and</span> <span class="n">obj</span><span class="o">.</span><span class="n">can_be_viewed_by</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-723"><a id="__codelineno-0-723" name="__codelineno-0-723"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-724"><a id="__codelineno-0-724" name="__codelineno-0-724"></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s2">"view_groups"</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-725"><a id="__codelineno-0-725" name="__codelineno-0-725"></a> <span class="k">for</span> <span class="n">pk</span> <span class="ow">in</span> <span class="n">obj</span><span class="o">.</span><span class="n">view_groups</span><span class="o">.</span><span class="n">values_list</span><span class="p">(</span><span class="s2">"pk"</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-726"><a id="__codelineno-0-726" name="__codelineno-0-726"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_in_group</span><span class="p">(</span><span class="n">pk</span><span class="o">=</span><span class="n">pk</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-727"><a id="__codelineno-0-727" name="__codelineno-0-727"></a> <span class="k">return</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-728"><a id="__codelineno-0-728" name="__codelineno-0-728"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">can_edit</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.User.clubs_with_rights" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">clubs_with_rights</span><span class="p">()</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.User.clubs_with_rights" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>The list of clubs where the user has rights</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>core/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-768">768</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-769">769</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-770">770</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-771">771</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-772">772</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-768"><a id="__codelineno-0-768" name="__codelineno-0-768"></a><span class="nd">@cached_property</span>
|
||
|
</span><span id="__span-0-769"><a id="__codelineno-0-769" name="__codelineno-0-769"></a><span class="k">def</span> <span class="nf">clubs_with_rights</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">[</span><span class="n">Club</span><span class="p">]:</span>
|
||
|
</span><span id="__span-0-770"><a id="__codelineno-0-770" name="__codelineno-0-770"></a><span class="w"> </span><span class="sd">"""The list of clubs where the user has rights"""</span>
|
||
|
</span><span id="__span-0-771"><a id="__codelineno-0-771" name="__codelineno-0-771"></a> <span class="n">memberships</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">memberships</span><span class="o">.</span><span class="n">ongoing</span><span class="p">()</span><span class="o">.</span><span class="n">board</span><span class="p">()</span><span class="o">.</span><span class="n">select_related</span><span class="p">(</span><span class="s2">"club"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-772"><a id="__codelineno-0-772" name="__codelineno-0-772"></a> <span class="k">return</span> <span class="p">[</span><span class="n">m</span><span class="o">.</span><span class="n">club</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">memberships</span><span class="p">]</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.CanEditPropMixin" class="doc doc-heading">
|
||
|
<code>CanEditPropMixin</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.CanEditPropMixin" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>GenericContentPermissionMixinBuilder</code></p>
|
||
|
|
||
|
|
||
|
<p>Ensure the user has owner permissions on the child view object.</p>
|
||
|
<p>In other word, you can make a view with this view as parent,
|
||
|
and it will be retricted to the users that are in the
|
||
|
object's owner_group or that pass the <code>obj.can_be_viewed_by</code> test.</p>
|
||
|
|
||
|
|
||
|
<p><span class="doc-section-title">Raises:</span></p>
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Type</th>
|
||
|
<th>Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>PermissionDenied</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>If the user cannot see the object</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.Customer" class="doc doc-heading">
|
||
|
<code>Customer</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.Customer" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>Model</code></p>
|
||
|
|
||
|
|
||
|
<p>Customer data of a User.</p>
|
||
|
<p>It adds some basic customers' information, such as the account ID, and
|
||
|
is used by other accounting classes as reference to the customer, rather than using User.</p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-object doc-attribute">
|
||
|
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.Customer.can_buy" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">can_buy</span><span class="p">:</span> <span class="nb">bool</span></code>
|
||
|
|
||
|
<span class="doc doc-labels">
|
||
|
<small class="doc doc-label doc-label-property"><code>property</code></small>
|
||
|
</span>
|
||
|
|
||
|
<a href="#rootplace.views.Customer.can_buy" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Check if whether this customer has the right to purchase any item.</p>
|
||
|
<p>This must be not confused with the Product.can_be_sold_to(user)
|
||
|
method as the present method returns an information
|
||
|
about a customer whereas the other tells something
|
||
|
about the relation between a User (not a Customer,
|
||
|
don't mix them) and a Product.</p>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.Customer.save" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">save</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">allow_negative</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">is_selling</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.Customer.save" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>is_selling : tell if the current action is a selling
|
||
|
allow_negative : ignored if not a selling. Allow a selling to put the account in negative
|
||
|
Those two parameters avoid blocking the save method of a customer if his account is negative.</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>counter/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-68">68</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-69">69</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-70">70</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-71">71</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-72">72</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-73">73</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-74">74</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-75">75</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-68"><a id="__codelineno-0-68" name="__codelineno-0-68"></a><span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">allow_negative</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">is_selling</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-69"><a id="__codelineno-0-69" name="__codelineno-0-69"></a><span class="w"> </span><span class="sd">"""is_selling : tell if the current action is a selling</span>
|
||
|
</span><span id="__span-0-70"><a id="__codelineno-0-70" name="__codelineno-0-70"></a><span class="sd"> allow_negative : ignored if not a selling. Allow a selling to put the account in negative</span>
|
||
|
</span><span id="__span-0-71"><a id="__codelineno-0-71" name="__codelineno-0-71"></a><span class="sd"> Those two parameters avoid blocking the save method of a customer if his account is negative.</span>
|
||
|
</span><span id="__span-0-72"><a id="__codelineno-0-72" name="__codelineno-0-72"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-73"><a id="__codelineno-0-73" name="__codelineno-0-73"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">amount</span> <span class="o"><</span> <span class="mi">0</span> <span class="ow">and</span> <span class="p">(</span><span class="n">is_selling</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">allow_negative</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-74"><a id="__codelineno-0-74" name="__codelineno-0-74"></a> <span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s2">"Not enough money"</span><span class="p">))</span>
|
||
|
</span><span id="__span-0-75"><a id="__codelineno-0-75" name="__codelineno-0-75"></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h3 id="rootplace.views.Customer.get_or_create" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">get_or_create</span><span class="p">(</span><span class="n">user</span><span class="p">)</span></code>
|
||
|
|
||
|
<span class="doc doc-labels">
|
||
|
<small class="doc doc-label doc-label-classmethod"><code>classmethod</code></small>
|
||
|
</span>
|
||
|
|
||
|
<a href="#rootplace.views.Customer.get_or_create" class="headerlink" title="Permanent link">¶</a></h3>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Work in pretty much the same way as the usual get_or_create method,
|
||
|
but with the default field replaced by some under the hood.</p>
|
||
|
<p>If the user has an account, return it as is.
|
||
|
Else create a new account with no money on it and a new unique account id</p>
|
||
|
<p>Example : ::</p>
|
||
|
<div class="language-text highlight"><pre><span></span><code>user = User.objects.get(pk=1)
|
||
|
account, created = Customer.get_or_create(user)
|
||
|
if created:
|
||
|
print(f"created a new account with id {account.id}")
|
||
|
else:
|
||
|
print(f"user has already an account, with {account.id} € on it"
|
||
|
</code></pre></div>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>counter/models.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-102">102</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-103">103</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-104">104</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-105">105</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-106">106</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-107">107</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-108">108</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-109">109</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-110">110</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-111">111</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-112">112</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-113">113</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-114">114</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-115">115</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-116">116</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-117">117</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-118">118</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-119">119</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-120">120</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-121">121</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-122">122</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-123">123</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-124">124</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-125">125</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-126">126</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-127">127</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-128">128</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-129">129</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-130">130</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-131">131</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-132">132</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-133">133</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-134">134</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-135">135</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-136">136</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-137">137</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-138">138</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-139">139</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-140">140</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-141">141</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-142">142</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-102"><a id="__codelineno-0-102" name="__codelineno-0-102"></a><span class="nd">@classmethod</span>
|
||
|
</span><span id="__span-0-103"><a id="__codelineno-0-103" name="__codelineno-0-103"></a><span class="k">def</span> <span class="nf">get_or_create</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">user</span><span class="p">:</span> <span class="n">User</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tuple</span><span class="p">[</span><span class="n">Customer</span><span class="p">,</span> <span class="nb">bool</span><span class="p">]:</span>
|
||
|
</span><span id="__span-0-104"><a id="__codelineno-0-104" name="__codelineno-0-104"></a><span class="w"> </span><span class="sd">"""Work in pretty much the same way as the usual get_or_create method,</span>
|
||
|
</span><span id="__span-0-105"><a id="__codelineno-0-105" name="__codelineno-0-105"></a><span class="sd"> but with the default field replaced by some under the hood.</span>
|
||
|
</span><span id="__span-0-106"><a id="__codelineno-0-106" name="__codelineno-0-106"></a>
|
||
|
</span><span id="__span-0-107"><a id="__codelineno-0-107" name="__codelineno-0-107"></a><span class="sd"> If the user has an account, return it as is.</span>
|
||
|
</span><span id="__span-0-108"><a id="__codelineno-0-108" name="__codelineno-0-108"></a><span class="sd"> Else create a new account with no money on it and a new unique account id</span>
|
||
|
</span><span id="__span-0-109"><a id="__codelineno-0-109" name="__codelineno-0-109"></a>
|
||
|
</span><span id="__span-0-110"><a id="__codelineno-0-110" name="__codelineno-0-110"></a><span class="sd"> Example : ::</span>
|
||
|
</span><span id="__span-0-111"><a id="__codelineno-0-111" name="__codelineno-0-111"></a>
|
||
|
</span><span id="__span-0-112"><a id="__codelineno-0-112" name="__codelineno-0-112"></a><span class="sd"> user = User.objects.get(pk=1)</span>
|
||
|
</span><span id="__span-0-113"><a id="__codelineno-0-113" name="__codelineno-0-113"></a><span class="sd"> account, created = Customer.get_or_create(user)</span>
|
||
|
</span><span id="__span-0-114"><a id="__codelineno-0-114" name="__codelineno-0-114"></a><span class="sd"> if created:</span>
|
||
|
</span><span id="__span-0-115"><a id="__codelineno-0-115" name="__codelineno-0-115"></a><span class="sd"> print(f"created a new account with id {account.id}")</span>
|
||
|
</span><span id="__span-0-116"><a id="__codelineno-0-116" name="__codelineno-0-116"></a><span class="sd"> else:</span>
|
||
|
</span><span id="__span-0-117"><a id="__codelineno-0-117" name="__codelineno-0-117"></a><span class="sd"> print(f"user has already an account, with {account.id} € on it"</span>
|
||
|
</span><span id="__span-0-118"><a id="__codelineno-0-118" name="__codelineno-0-118"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-119"><a id="__codelineno-0-119" name="__codelineno-0-119"></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">user</span><span class="p">,</span> <span class="s2">"customer"</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-120"><a id="__codelineno-0-120" name="__codelineno-0-120"></a> <span class="k">return</span> <span class="n">user</span><span class="o">.</span><span class="n">customer</span><span class="p">,</span> <span class="kc">False</span>
|
||
|
</span><span id="__span-0-121"><a id="__codelineno-0-121" name="__codelineno-0-121"></a>
|
||
|
</span><span id="__span-0-122"><a id="__codelineno-0-122" name="__codelineno-0-122"></a> <span class="c1"># account_id are always a number with a letter appended</span>
|
||
|
</span><span id="__span-0-123"><a id="__codelineno-0-123" name="__codelineno-0-123"></a> <span class="n">account_id</span> <span class="o">=</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-124"><a id="__codelineno-0-124" name="__codelineno-0-124"></a> <span class="n">Customer</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">order_by</span><span class="p">(</span><span class="n">Length</span><span class="p">(</span><span class="s2">"account_id"</span><span class="p">),</span> <span class="s2">"account_id"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-125"><a id="__codelineno-0-125" name="__codelineno-0-125"></a> <span class="o">.</span><span class="n">values</span><span class="p">(</span><span class="s2">"account_id"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-126"><a id="__codelineno-0-126" name="__codelineno-0-126"></a> <span class="o">.</span><span class="n">last</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-127"><a id="__codelineno-0-127" name="__codelineno-0-127"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-128"><a id="__codelineno-0-128" name="__codelineno-0-128"></a> <span class="k">if</span> <span class="n">account_id</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-129"><a id="__codelineno-0-129" name="__codelineno-0-129"></a> <span class="c1"># legacy from the old site</span>
|
||
|
</span><span id="__span-0-130"><a id="__codelineno-0-130" name="__codelineno-0-130"></a> <span class="n">account</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">user</span><span class="o">=</span><span class="n">user</span><span class="p">,</span> <span class="n">account_id</span><span class="o">=</span><span class="s2">"1504a"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-131"><a id="__codelineno-0-131" name="__codelineno-0-131"></a> <span class="k">return</span> <span class="n">account</span><span class="p">,</span> <span class="kc">True</span>
|
||
|
</span><span id="__span-0-132"><a id="__codelineno-0-132" name="__codelineno-0-132"></a>
|
||
|
</span><span id="__span-0-133"><a id="__codelineno-0-133" name="__codelineno-0-133"></a> <span class="n">account_id</span> <span class="o">=</span> <span class="n">account_id</span><span class="p">[</span><span class="s2">"account_id"</span><span class="p">]</span>
|
||
|
</span><span id="__span-0-134"><a id="__codelineno-0-134" name="__codelineno-0-134"></a> <span class="n">account_num</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">account_id</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
|
||
|
</span><span id="__span-0-135"><a id="__codelineno-0-135" name="__codelineno-0-135"></a> <span class="k">while</span> <span class="n">Customer</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">account_id</span><span class="o">=</span><span class="n">account_id</span><span class="p">)</span><span class="o">.</span><span class="n">exists</span><span class="p">():</span>
|
||
|
</span><span id="__span-0-136"><a id="__codelineno-0-136" name="__codelineno-0-136"></a> <span class="c1"># when entering the first iteration, we are using an already existing account id</span>
|
||
|
</span><span id="__span-0-137"><a id="__codelineno-0-137" name="__codelineno-0-137"></a> <span class="c1"># so the loop should always execute at least one time</span>
|
||
|
</span><span id="__span-0-138"><a id="__codelineno-0-138" name="__codelineno-0-138"></a> <span class="n">account_num</span> <span class="o">+=</span> <span class="mi">1</span>
|
||
|
</span><span id="__span-0-139"><a id="__codelineno-0-139" name="__codelineno-0-139"></a> <span class="n">account_id</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">account_num</span><span class="si">}{</span><span class="n">random</span><span class="o">.</span><span class="n">choice</span><span class="p">(</span><span class="n">string</span><span class="o">.</span><span class="n">ascii_lowercase</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span>
|
||
|
</span><span id="__span-0-140"><a id="__codelineno-0-140" name="__codelineno-0-140"></a>
|
||
|
</span><span id="__span-0-141"><a id="__codelineno-0-141" name="__codelineno-0-141"></a> <span class="n">account</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">user</span><span class="o">=</span><span class="n">user</span><span class="p">,</span> <span class="n">account_id</span><span class="o">=</span><span class="n">account_id</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-142"><a id="__codelineno-0-142" name="__codelineno-0-142"></a> <span class="k">return</span> <span class="n">account</span><span class="p">,</span> <span class="kc">True</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.ForumMessageMeta" class="doc doc-heading">
|
||
|
<code>ForumMessageMeta</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.ForumMessageMeta" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>Model</code></p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.MergeForm" class="doc doc-heading">
|
||
|
<code>MergeForm</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.MergeForm" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>Form</code></p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.SelectUserForm" class="doc doc-heading">
|
||
|
<code>SelectUserForm</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.SelectUserForm" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>Form</code></p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.MergeUsersView" class="doc doc-heading">
|
||
|
<code>MergeUsersView</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.MergeUsersView" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>FormView</code></p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.DeleteAllForumUserMessagesView" class="doc doc-heading">
|
||
|
<code>DeleteAllForumUserMessagesView</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.DeleteAllForumUserMessagesView" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>FormView</code></p>
|
||
|
|
||
|
|
||
|
<p>Delete all forum messages from an user.</p>
|
||
|
<p>Messages are soft deleted and are still visible from admins
|
||
|
GUI frontend to the dedicated command.</p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-class">
|
||
|
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.OperationLogListView" class="doc doc-heading">
|
||
|
<code>OperationLogListView</code>
|
||
|
|
||
|
|
||
|
<a href="#rootplace.views.OperationLogListView" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
<p class="doc doc-class-bases">
|
||
|
Bases: <code>ListView</code>, <code>CanEditPropMixin</code></p>
|
||
|
|
||
|
|
||
|
<p>List all logs.</p>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="doc doc-children">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.__merge_subscriptions" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">__merge_subscriptions</span><span class="p">(</span><span class="n">u1</span><span class="p">,</span> <span class="n">u2</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.__merge_subscriptions" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Give all the subscriptions of the second user to first one.</p>
|
||
|
<p>If some subscriptions are still active, update their end date
|
||
|
to increase the overall subscription time of the first user.</p>
|
||
|
<p>Some examples :
|
||
|
- if u1 is not subscribed, his subscription end date become the one of u2
|
||
|
- if u1 is subscribed but not u2, nothing happen
|
||
|
- if u1 is subscribed for, let's say,
|
||
|
2 remaining months and u2 is subscribed for 3 remaining months,
|
||
|
he shall then be subscribed for 5 months</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>rootplace/views.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-42">42</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-43">43</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-44">44</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-45">45</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-46">46</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-47">47</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-48">48</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-49">49</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-50">50</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-51">51</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-52">52</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-53">53</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-54">54</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-55">55</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-56">56</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-57">57</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-58">58</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-59">59</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-60">60</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-61">61</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-62">62</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-63">63</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-64">64</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-65">65</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-66">66</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-67">67</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-68">68</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-69">69</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-70">70</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-71">71</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-72">72</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-73">73</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-74">74</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-75">75</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-76">76</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-77">77</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-42"><a id="__codelineno-0-42" name="__codelineno-0-42"></a><span class="k">def</span> <span class="nf">__merge_subscriptions</span><span class="p">(</span><span class="n">u1</span><span class="p">:</span> <span class="n">User</span><span class="p">,</span> <span class="n">u2</span><span class="p">:</span> <span class="n">User</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-43"><a id="__codelineno-0-43" name="__codelineno-0-43"></a><span class="w"> </span><span class="sd">"""Give all the subscriptions of the second user to first one.</span>
|
||
|
</span><span id="__span-0-44"><a id="__codelineno-0-44" name="__codelineno-0-44"></a>
|
||
|
</span><span id="__span-0-45"><a id="__codelineno-0-45" name="__codelineno-0-45"></a><span class="sd"> If some subscriptions are still active, update their end date</span>
|
||
|
</span><span id="__span-0-46"><a id="__codelineno-0-46" name="__codelineno-0-46"></a><span class="sd"> to increase the overall subscription time of the first user.</span>
|
||
|
</span><span id="__span-0-47"><a id="__codelineno-0-47" name="__codelineno-0-47"></a>
|
||
|
</span><span id="__span-0-48"><a id="__codelineno-0-48" name="__codelineno-0-48"></a><span class="sd"> Some examples :</span>
|
||
|
</span><span id="__span-0-49"><a id="__codelineno-0-49" name="__codelineno-0-49"></a><span class="sd"> - if u1 is not subscribed, his subscription end date become the one of u2</span>
|
||
|
</span><span id="__span-0-50"><a id="__codelineno-0-50" name="__codelineno-0-50"></a><span class="sd"> - if u1 is subscribed but not u2, nothing happen</span>
|
||
|
</span><span id="__span-0-51"><a id="__codelineno-0-51" name="__codelineno-0-51"></a><span class="sd"> - if u1 is subscribed for, let's say,</span>
|
||
|
</span><span id="__span-0-52"><a id="__codelineno-0-52" name="__codelineno-0-52"></a><span class="sd"> 2 remaining months and u2 is subscribed for 3 remaining months,</span>
|
||
|
</span><span id="__span-0-53"><a id="__codelineno-0-53" name="__codelineno-0-53"></a><span class="sd"> he shall then be subscribed for 5 months</span>
|
||
|
</span><span id="__span-0-54"><a id="__codelineno-0-54" name="__codelineno-0-54"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-55"><a id="__codelineno-0-55" name="__codelineno-0-55"></a> <span class="n">last_subscription</span> <span class="o">=</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-56"><a id="__codelineno-0-56" name="__codelineno-0-56"></a> <span class="n">u1</span><span class="o">.</span><span class="n">subscriptions</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-57"><a id="__codelineno-0-57" name="__codelineno-0-57"></a> <span class="n">subscription_start__lte</span><span class="o">=</span><span class="n">timezone</span><span class="o">.</span><span class="n">now</span><span class="p">(),</span> <span class="n">subscription_end__gte</span><span class="o">=</span><span class="n">timezone</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-58"><a id="__codelineno-0-58" name="__codelineno-0-58"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-59"><a id="__codelineno-0-59" name="__codelineno-0-59"></a> <span class="o">.</span><span class="n">order_by</span><span class="p">(</span><span class="s2">"subscription_end"</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-60"><a id="__codelineno-0-60" name="__codelineno-0-60"></a> <span class="o">.</span><span class="n">last</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-61"><a id="__codelineno-0-61" name="__codelineno-0-61"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-62"><a id="__codelineno-0-62" name="__codelineno-0-62"></a> <span class="k">if</span> <span class="n">last_subscription</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-63"><a id="__codelineno-0-63" name="__codelineno-0-63"></a> <span class="n">subscription_end</span> <span class="o">=</span> <span class="n">last_subscription</span><span class="o">.</span><span class="n">subscription_end</span>
|
||
|
</span><span id="__span-0-64"><a id="__codelineno-0-64" name="__codelineno-0-64"></a> <span class="k">for</span> <span class="n">subscription</span> <span class="ow">in</span> <span class="n">u2</span><span class="o">.</span><span class="n">subscriptions</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-65"><a id="__codelineno-0-65" name="__codelineno-0-65"></a> <span class="n">subscription_end__gte</span><span class="o">=</span><span class="n">timezone</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-66"><a id="__codelineno-0-66" name="__codelineno-0-66"></a> <span class="p">):</span>
|
||
|
</span><span id="__span-0-67"><a id="__codelineno-0-67" name="__codelineno-0-67"></a> <span class="n">subscription</span><span class="o">.</span><span class="n">subscription_start</span> <span class="o">=</span> <span class="n">subscription_end</span>
|
||
|
</span><span id="__span-0-68"><a id="__codelineno-0-68" name="__codelineno-0-68"></a> <span class="k">if</span> <span class="n">subscription</span><span class="o">.</span><span class="n">subscription_start</span> <span class="o">></span> <span class="n">localdate</span><span class="p">():</span>
|
||
|
</span><span id="__span-0-69"><a id="__codelineno-0-69" name="__codelineno-0-69"></a> <span class="n">remaining</span> <span class="o">=</span> <span class="n">subscription</span><span class="o">.</span><span class="n">subscription_end</span> <span class="o">-</span> <span class="n">localdate</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-70"><a id="__codelineno-0-70" name="__codelineno-0-70"></a> <span class="k">else</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-71"><a id="__codelineno-0-71" name="__codelineno-0-71"></a> <span class="n">remaining</span> <span class="o">=</span> <span class="p">(</span>
|
||
|
</span><span id="__span-0-72"><a id="__codelineno-0-72" name="__codelineno-0-72"></a> <span class="n">subscription</span><span class="o">.</span><span class="n">subscription_end</span> <span class="o">-</span> <span class="n">subscription</span><span class="o">.</span><span class="n">subscription_start</span>
|
||
|
</span><span id="__span-0-73"><a id="__codelineno-0-73" name="__codelineno-0-73"></a> <span class="p">)</span>
|
||
|
</span><span id="__span-0-74"><a id="__codelineno-0-74" name="__codelineno-0-74"></a> <span class="n">subscription_end</span> <span class="o">+=</span> <span class="n">remaining</span>
|
||
|
</span><span id="__span-0-75"><a id="__codelineno-0-75" name="__codelineno-0-75"></a> <span class="n">subscription</span><span class="o">.</span><span class="n">subscription_end</span> <span class="o">=</span> <span class="n">subscription_end</span>
|
||
|
</span><span id="__span-0-76"><a id="__codelineno-0-76" name="__codelineno-0-76"></a> <span class="n">subscription</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-77"><a id="__codelineno-0-77" name="__codelineno-0-77"></a> <span class="n">u2</span><span class="o">.</span><span class="n">subscriptions</span><span class="o">.</span><span class="n">all</span><span class="p">()</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">member</span><span class="o">=</span><span class="n">u1</span><span class="p">)</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.__merge_pictures" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">__merge_pictures</span><span class="p">(</span><span class="n">u1</span><span class="p">,</span> <span class="n">u2</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.__merge_pictures" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>rootplace/views.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-80">80</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-81">81</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-82">82</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-83">83</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-84">84</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-85">85</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-86">86</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-87">87</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-88">88</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-89">89</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-80"><a id="__codelineno-0-80" name="__codelineno-0-80"></a><span class="k">def</span> <span class="nf">__merge_pictures</span><span class="p">(</span><span class="n">u1</span><span class="p">:</span> <span class="n">User</span><span class="p">,</span> <span class="n">u2</span><span class="p">:</span> <span class="n">User</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-81"><a id="__codelineno-0-81" name="__codelineno-0-81"></a> <span class="n">SithFile</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">owner</span><span class="o">=</span><span class="n">u2</span><span class="p">)</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">owner</span><span class="o">=</span><span class="n">u1</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-82"><a id="__codelineno-0-82" name="__codelineno-0-82"></a> <span class="k">if</span> <span class="n">u1</span><span class="o">.</span><span class="n">profile_pict</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">u2</span><span class="o">.</span><span class="n">profile_pict</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-83"><a id="__codelineno-0-83" name="__codelineno-0-83"></a> <span class="n">u1</span><span class="o">.</span><span class="n">profile_pict</span><span class="p">,</span> <span class="n">u2</span><span class="o">.</span><span class="n">profile_pict</span> <span class="o">=</span> <span class="n">u2</span><span class="o">.</span><span class="n">profile_pict</span><span class="p">,</span> <span class="kc">None</span>
|
||
|
</span><span id="__span-0-84"><a id="__codelineno-0-84" name="__codelineno-0-84"></a> <span class="k">if</span> <span class="n">u1</span><span class="o">.</span><span class="n">scrub_pict</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">u2</span><span class="o">.</span><span class="n">scrub_pict</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-85"><a id="__codelineno-0-85" name="__codelineno-0-85"></a> <span class="n">u1</span><span class="o">.</span><span class="n">scrub_pict</span><span class="p">,</span> <span class="n">u2</span><span class="o">.</span><span class="n">scrub_pict</span> <span class="o">=</span> <span class="n">u2</span><span class="o">.</span><span class="n">scrub_pict</span><span class="p">,</span> <span class="kc">None</span>
|
||
|
</span><span id="__span-0-86"><a id="__codelineno-0-86" name="__codelineno-0-86"></a> <span class="k">if</span> <span class="n">u1</span><span class="o">.</span><span class="n">avatar_pict</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">u2</span><span class="o">.</span><span class="n">avatar_pict</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-87"><a id="__codelineno-0-87" name="__codelineno-0-87"></a> <span class="n">u1</span><span class="o">.</span><span class="n">avatar_pict</span><span class="p">,</span> <span class="n">u2</span><span class="o">.</span><span class="n">avatar_pict</span> <span class="o">=</span> <span class="n">u2</span><span class="o">.</span><span class="n">avatar_pict</span><span class="p">,</span> <span class="kc">None</span>
|
||
|
</span><span id="__span-0-88"><a id="__codelineno-0-88" name="__codelineno-0-88"></a> <span class="n">u2</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-89"><a id="__codelineno-0-89" name="__codelineno-0-89"></a> <span class="n">u1</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.merge_users" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">merge_users</span><span class="p">(</span><span class="n">u1</span><span class="p">,</span> <span class="n">u2</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.merge_users" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Merge u2 into u1.</p>
|
||
|
<p>This means that u1 shall receive everything that belonged to u2 :</p>
|
||
|
<div class="language-text highlight"><pre><span></span><code>- pictures
|
||
|
- refills of the sith account
|
||
|
- purchases of any item bought on the eboutic or the counters
|
||
|
- subscriptions
|
||
|
- godfathers
|
||
|
- godchildren
|
||
|
</code></pre></div>
|
||
|
<p>If u1 had no account id, he shall receive the one of u2.
|
||
|
If u1 and u2 were both in the middle of a subscription, the remaining
|
||
|
durations stack
|
||
|
If u1 had no profile picture, he shall receive the one of u2</p>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>rootplace/views.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-92"> 92</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-93"> 93</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-94"> 94</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-95"> 95</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-96"> 96</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-97"> 97</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-98"> 98</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-99"> 99</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-100">100</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-101">101</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-102">102</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-103">103</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-104">104</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-105">105</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-106">106</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-107">107</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-108">108</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-109">109</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-110">110</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-111">111</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-112">112</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-113">113</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-114">114</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-115">115</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-116">116</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-117">117</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-118">118</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-119">119</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-120">120</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-121">121</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-122">122</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-123">123</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-124">124</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-125">125</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-126">126</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-127">127</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-128">128</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-129">129</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-130">130</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-131">131</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-132">132</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-133">133</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-134">134</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-135">135</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-136">136</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-92"><a id="__codelineno-0-92" name="__codelineno-0-92"></a><span class="k">def</span> <span class="nf">merge_users</span><span class="p">(</span><span class="n">u1</span><span class="p">:</span> <span class="n">User</span><span class="p">,</span> <span class="n">u2</span><span class="p">:</span> <span class="n">User</span><span class="p">)</span> <span class="o">-></span> <span class="n">User</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-93"><a id="__codelineno-0-93" name="__codelineno-0-93"></a><span class="w"> </span><span class="sd">"""Merge u2 into u1.</span>
|
||
|
</span><span id="__span-0-94"><a id="__codelineno-0-94" name="__codelineno-0-94"></a>
|
||
|
</span><span id="__span-0-95"><a id="__codelineno-0-95" name="__codelineno-0-95"></a><span class="sd"> This means that u1 shall receive everything that belonged to u2 :</span>
|
||
|
</span><span id="__span-0-96"><a id="__codelineno-0-96" name="__codelineno-0-96"></a>
|
||
|
</span><span id="__span-0-97"><a id="__codelineno-0-97" name="__codelineno-0-97"></a><span class="sd"> - pictures</span>
|
||
|
</span><span id="__span-0-98"><a id="__codelineno-0-98" name="__codelineno-0-98"></a><span class="sd"> - refills of the sith account</span>
|
||
|
</span><span id="__span-0-99"><a id="__codelineno-0-99" name="__codelineno-0-99"></a><span class="sd"> - purchases of any item bought on the eboutic or the counters</span>
|
||
|
</span><span id="__span-0-100"><a id="__codelineno-0-100" name="__codelineno-0-100"></a><span class="sd"> - subscriptions</span>
|
||
|
</span><span id="__span-0-101"><a id="__codelineno-0-101" name="__codelineno-0-101"></a><span class="sd"> - godfathers</span>
|
||
|
</span><span id="__span-0-102"><a id="__codelineno-0-102" name="__codelineno-0-102"></a><span class="sd"> - godchildren</span>
|
||
|
</span><span id="__span-0-103"><a id="__codelineno-0-103" name="__codelineno-0-103"></a>
|
||
|
</span><span id="__span-0-104"><a id="__codelineno-0-104" name="__codelineno-0-104"></a><span class="sd"> If u1 had no account id, he shall receive the one of u2.</span>
|
||
|
</span><span id="__span-0-105"><a id="__codelineno-0-105" name="__codelineno-0-105"></a><span class="sd"> If u1 and u2 were both in the middle of a subscription, the remaining</span>
|
||
|
</span><span id="__span-0-106"><a id="__codelineno-0-106" name="__codelineno-0-106"></a><span class="sd"> durations stack</span>
|
||
|
</span><span id="__span-0-107"><a id="__codelineno-0-107" name="__codelineno-0-107"></a><span class="sd"> If u1 had no profile picture, he shall receive the one of u2</span>
|
||
|
</span><span id="__span-0-108"><a id="__codelineno-0-108" name="__codelineno-0-108"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-109"><a id="__codelineno-0-109" name="__codelineno-0-109"></a> <span class="k">for</span> <span class="n">field</span> <span class="ow">in</span> <span class="n">u1</span><span class="o">.</span><span class="n">_meta</span><span class="o">.</span><span class="n">fields</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-110"><a id="__codelineno-0-110" name="__codelineno-0-110"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">field</span><span class="o">.</span><span class="n">is_relation</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">u1</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">[</span><span class="n">field</span><span class="o">.</span><span class="n">name</span><span class="p">]:</span>
|
||
|
</span><span id="__span-0-111"><a id="__codelineno-0-111" name="__codelineno-0-111"></a> <span class="n">u1</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">[</span><span class="n">field</span><span class="o">.</span><span class="n">name</span><span class="p">]</span> <span class="o">=</span> <span class="n">u2</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">[</span><span class="n">field</span><span class="o">.</span><span class="n">name</span><span class="p">]</span>
|
||
|
</span><span id="__span-0-112"><a id="__codelineno-0-112" name="__codelineno-0-112"></a> <span class="k">for</span> <span class="n">group</span> <span class="ow">in</span> <span class="n">u2</span><span class="o">.</span><span class="n">groups</span><span class="o">.</span><span class="n">all</span><span class="p">():</span>
|
||
|
</span><span id="__span-0-113"><a id="__codelineno-0-113" name="__codelineno-0-113"></a> <span class="n">u1</span><span class="o">.</span><span class="n">groups</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">group</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-114"><a id="__codelineno-0-114" name="__codelineno-0-114"></a> <span class="k">for</span> <span class="n">godfather</span> <span class="ow">in</span> <span class="n">u2</span><span class="o">.</span><span class="n">godfathers</span><span class="o">.</span><span class="n">exclude</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">u1</span><span class="o">.</span><span class="n">id</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-115"><a id="__codelineno-0-115" name="__codelineno-0-115"></a> <span class="n">u1</span><span class="o">.</span><span class="n">godfathers</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">godfather</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-116"><a id="__codelineno-0-116" name="__codelineno-0-116"></a> <span class="k">for</span> <span class="n">godchild</span> <span class="ow">in</span> <span class="n">u2</span><span class="o">.</span><span class="n">godchildren</span><span class="o">.</span><span class="n">exclude</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">u1</span><span class="o">.</span><span class="n">id</span><span class="p">):</span>
|
||
|
</span><span id="__span-0-117"><a id="__codelineno-0-117" name="__codelineno-0-117"></a> <span class="n">u1</span><span class="o">.</span><span class="n">godchildren</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">godchild</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-118"><a id="__codelineno-0-118" name="__codelineno-0-118"></a> <span class="n">__merge_subscriptions</span><span class="p">(</span><span class="n">u1</span><span class="p">,</span> <span class="n">u2</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-119"><a id="__codelineno-0-119" name="__codelineno-0-119"></a> <span class="n">__merge_pictures</span><span class="p">(</span><span class="n">u1</span><span class="p">,</span> <span class="n">u2</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-120"><a id="__codelineno-0-120" name="__codelineno-0-120"></a> <span class="n">u2</span><span class="o">.</span><span class="n">invoices</span><span class="o">.</span><span class="n">all</span><span class="p">()</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">user</span><span class="o">=</span><span class="n">u1</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-121"><a id="__codelineno-0-121" name="__codelineno-0-121"></a> <span class="n">c_src</span> <span class="o">=</span> <span class="n">Customer</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">user</span><span class="o">=</span><span class="n">u2</span><span class="p">)</span><span class="o">.</span><span class="n">first</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-122"><a id="__codelineno-0-122" name="__codelineno-0-122"></a> <span class="k">if</span> <span class="n">c_src</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-123"><a id="__codelineno-0-123" name="__codelineno-0-123"></a> <span class="n">c_dest</span><span class="p">,</span> <span class="n">created</span> <span class="o">=</span> <span class="n">Customer</span><span class="o">.</span><span class="n">get_or_create</span><span class="p">(</span><span class="n">u1</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-124"><a id="__codelineno-0-124" name="__codelineno-0-124"></a> <span class="n">c_src</span><span class="o">.</span><span class="n">refillings</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">customer</span><span class="o">=</span><span class="n">c_dest</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-125"><a id="__codelineno-0-125" name="__codelineno-0-125"></a> <span class="n">c_src</span><span class="o">.</span><span class="n">buyings</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">customer</span><span class="o">=</span><span class="n">c_dest</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-126"><a id="__codelineno-0-126" name="__codelineno-0-126"></a> <span class="n">c_dest</span><span class="o">.</span><span class="n">recompute_amount</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-127"><a id="__codelineno-0-127" name="__codelineno-0-127"></a> <span class="k">if</span> <span class="n">created</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-128"><a id="__codelineno-0-128" name="__codelineno-0-128"></a> <span class="c1"># swap the account numbers, so that the user keep</span>
|
||
|
</span><span id="__span-0-129"><a id="__codelineno-0-129" name="__codelineno-0-129"></a> <span class="c1"># the id he is accustomed to</span>
|
||
|
</span><span id="__span-0-130"><a id="__codelineno-0-130" name="__codelineno-0-130"></a> <span class="n">tmp_id</span> <span class="o">=</span> <span class="n">c_src</span><span class="o">.</span><span class="n">account_id</span>
|
||
|
</span><span id="__span-0-131"><a id="__codelineno-0-131" name="__codelineno-0-131"></a> <span class="c1"># delete beforehand in order not to have a unique constraint violation</span>
|
||
|
</span><span id="__span-0-132"><a id="__codelineno-0-132" name="__codelineno-0-132"></a> <span class="n">c_src</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-133"><a id="__codelineno-0-133" name="__codelineno-0-133"></a> <span class="n">c_dest</span><span class="o">.</span><span class="n">account_id</span> <span class="o">=</span> <span class="n">tmp_id</span>
|
||
|
</span><span id="__span-0-134"><a id="__codelineno-0-134" name="__codelineno-0-134"></a> <span class="n">u1</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||
|
</span><span id="__span-0-135"><a id="__codelineno-0-135" name="__codelineno-0-135"></a> <span class="n">u2</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span> <span class="c1"># everything remaining in u2 gets deleted thanks to on_delete=CASCADE</span>
|
||
|
</span><span id="__span-0-136"><a id="__codelineno-0-136" name="__codelineno-0-136"></a> <span class="k">return</span> <span class="n">u1</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="doc doc-object doc-function">
|
||
|
|
||
|
|
||
|
<h2 id="rootplace.views.delete_all_forum_user_messages" class="doc doc-heading">
|
||
|
<code class="highlight language-python"><span class="n">delete_all_forum_user_messages</span><span class="p">(</span><span class="n">user</span><span class="p">,</span> <span class="n">moderator</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span></code>
|
||
|
|
||
|
<a href="#rootplace.views.delete_all_forum_user_messages" class="headerlink" title="Permanent link">¶</a></h2>
|
||
|
|
||
|
|
||
|
<div class="doc doc-contents ">
|
||
|
|
||
|
<p>Soft delete all messages of a user.</p>
|
||
|
|
||
|
|
||
|
<p><span class="doc-section-title">Parameters:</span></p>
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Name</th>
|
||
|
<th>Type</th>
|
||
|
<th>Description</th>
|
||
|
<th>Default</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>user</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>User</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>core.models.User the user to delete messages from</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
<td>
|
||
|
<em>required</em>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>moderator</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>User</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>core.models.User the one marked as the moderator.</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
<td>
|
||
|
<em>required</em>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="doc-section-item">
|
||
|
<td>
|
||
|
<code>verbose</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>bool</code>
|
||
|
</td>
|
||
|
<td>
|
||
|
<div class="doc-md-description">
|
||
|
<p>bool if True, print the deleted messages</p>
|
||
|
</div>
|
||
|
</td>
|
||
|
<td>
|
||
|
<code>False</code>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<details class="quote">
|
||
|
<summary>Source code in <code>rootplace/views.py</code></summary>
|
||
|
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-139">139</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-140">140</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-141">141</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-142">142</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-143">143</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-144">144</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-145">145</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-146">146</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-147">147</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-148">148</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-149">149</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-150">150</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-151">151</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-152">152</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-153">153</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-154">154</a></span>
|
||
|
<span class="normal"><a href="#__codelineno-0-155">155</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-139"><a id="__codelineno-0-139" name="__codelineno-0-139"></a><span class="k">def</span> <span class="nf">delete_all_forum_user_messages</span><span class="p">(</span>
|
||
|
</span><span id="__span-0-140"><a id="__codelineno-0-140" name="__codelineno-0-140"></a> <span class="n">user</span><span class="p">:</span> <span class="n">User</span><span class="p">,</span> <span class="n">moderator</span><span class="p">:</span> <span class="n">User</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">verbose</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span>
|
||
|
</span><span id="__span-0-141"><a id="__codelineno-0-141" name="__codelineno-0-141"></a><span class="p">):</span>
|
||
|
</span><span id="__span-0-142"><a id="__codelineno-0-142" name="__codelineno-0-142"></a><span class="w"> </span><span class="sd">"""Soft delete all messages of a user.</span>
|
||
|
</span><span id="__span-0-143"><a id="__codelineno-0-143" name="__codelineno-0-143"></a>
|
||
|
</span><span id="__span-0-144"><a id="__codelineno-0-144" name="__codelineno-0-144"></a><span class="sd"> Args:</span>
|
||
|
</span><span id="__span-0-145"><a id="__codelineno-0-145" name="__codelineno-0-145"></a><span class="sd"> user: core.models.User the user to delete messages from</span>
|
||
|
</span><span id="__span-0-146"><a id="__codelineno-0-146" name="__codelineno-0-146"></a><span class="sd"> moderator: core.models.User the one marked as the moderator.</span>
|
||
|
</span><span id="__span-0-147"><a id="__codelineno-0-147" name="__codelineno-0-147"></a><span class="sd"> verbose: bool if True, print the deleted messages</span>
|
||
|
</span><span id="__span-0-148"><a id="__codelineno-0-148" name="__codelineno-0-148"></a><span class="sd"> """</span>
|
||
|
</span><span id="__span-0-149"><a id="__codelineno-0-149" name="__codelineno-0-149"></a> <span class="k">for</span> <span class="n">message</span> <span class="ow">in</span> <span class="n">user</span><span class="o">.</span><span class="n">forum_messages</span><span class="o">.</span><span class="n">all</span><span class="p">():</span>
|
||
|
</span><span id="__span-0-150"><a id="__codelineno-0-150" name="__codelineno-0-150"></a> <span class="k">if</span> <span class="n">message</span><span class="o">.</span><span class="n">is_deleted</span><span class="p">():</span>
|
||
|
</span><span id="__span-0-151"><a id="__codelineno-0-151" name="__codelineno-0-151"></a> <span class="k">continue</span>
|
||
|
</span><span id="__span-0-152"><a id="__codelineno-0-152" name="__codelineno-0-152"></a>
|
||
|
</span><span id="__span-0-153"><a id="__codelineno-0-153" name="__codelineno-0-153"></a> <span class="k">if</span> <span class="n">verbose</span><span class="p">:</span>
|
||
|
</span><span id="__span-0-154"><a id="__codelineno-0-154" name="__codelineno-0-154"></a> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"django"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
|
||
|
</span><span id="__span-0-155"><a id="__codelineno-0-155" name="__codelineno-0-155"></a> <span class="n">ForumMessageMeta</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="n">message</span><span class="p">,</span> <span class="n">user</span><span class="o">=</span><span class="n">moderator</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"DELETE"</span><span class="p">)</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||
|
</span></code></pre></div></td></tr></table></div>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</article>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
|
||
|
|
||
|
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
|
||
|
</div>
|
||
|
|
||
|
</main>
|
||
|
|
||
|
<footer class="md-footer">
|
||
|
|
||
|
|
||
|
|
||
|
<nav class="md-footer__inner md-grid" aria-label="Pied de page" >
|
||
|
|
||
|
|
||
|
<a href="../models/" class="md-footer__link md-footer__link--prev" aria-label="Précédent: Models">
|
||
|
<div class="md-footer__button md-icon">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
|
||
|
</div>
|
||
|
<div class="md-footer__title">
|
||
|
<span class="md-footer__direction">
|
||
|
Précédent
|
||
|
</span>
|
||
|
<div class="md-ellipsis">
|
||
|
Models
|
||
|
</div>
|
||
|
</div>
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
<a href="../../sas/models/" class="md-footer__link md-footer__link--next" aria-label="Suivant: Models">
|
||
|
<div class="md-footer__title">
|
||
|
<span class="md-footer__direction">
|
||
|
Suivant
|
||
|
</span>
|
||
|
<div class="md-ellipsis">
|
||
|
Models
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="md-footer__button md-icon">
|
||
|
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg>
|
||
|
</div>
|
||
|
</a>
|
||
|
|
||
|
</nav>
|
||
|
|
||
|
|
||
|
<div class="md-footer-meta md-typeset">
|
||
|
<div class="md-footer-meta__inner md-grid">
|
||
|
<div class="md-copyright">
|
||
|
|
||
|
|
||
|
Made with
|
||
|
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
||
|
Material for MkDocs
|
||
|
</a>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</footer>
|
||
|
|
||
|
</div>
|
||
|
<div class="md-dialog" data-md-component="dialog">
|
||
|
<div class="md-dialog__inner md-typeset"></div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.footer", "content.code.annotate", "content.code.copy", "content.tabs.link"], "search": "../../../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copi\u00e9 dans le presse-papier", "clipboard.copy": "Copier dans le presse-papier", "search.result.more.one": "1 de plus sur cette page", "search.result.more.other": "# de plus sur cette page", "search.result.none": "Aucun document trouv\u00e9", "search.result.one": "1 document trouv\u00e9", "search.result.other": "# documents trouv\u00e9s", "search.result.placeholder": "Taper pour d\u00e9marrer la recherche", "search.result.term.missing": "Non trouv\u00e9", "select.version": "S\u00e9lectionner la version"}}</script>
|
||
|
|
||
|
|
||
|
<script src="../../../assets/javascripts/bundle.525ec568.min.js"></script>
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|