mirror of
https://github.com/ae-utbm/sith.git
synced 2025-04-05 11:20:24 +00:00
4250 lines
138 KiB
HTML
4250 lines
138 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/club/models/">
|
|
|
|
|
|
<link rel="prev" href="../../antispam/forms/">
|
|
|
|
|
|
<link rel="next" href="../views/">
|
|
|
|
|
|
<link rel="icon" href="../../../img/favicon.png">
|
|
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.7">
|
|
|
|
|
|
|
|
<title>Models - Site AE UTBM</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../../assets/stylesheets/main.8608ea7d.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="#club.models.Club" 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">
|
|
|
|
Models
|
|
|
|
</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.7.2 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.7.2 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/fragments/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Créer des fragments
|
|
|
|
</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">
|
|
antispam
|
|
|
|
</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>
|
|
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--active md-nav__item--nested">
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" checked>
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_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_2_label" aria-expanded="true">
|
|
<label class="md-nav__title" for="__nav_5_2">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
club
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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">
|
|
Models
|
|
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<a href="./" class="md-nav__link md-nav__link--active">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Models
|
|
|
|
</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="#club.models.Club" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
Club
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Club">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.president" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
president
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.check_loop" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
check_loop
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.is_owned_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
is_owned_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.can_be_edited_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
can_be_edited_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.can_be_viewed_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
can_be_viewed_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.get_membership_for" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
get_membership_for
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
MembershipQuerySet
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="MembershipQuerySet">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.ongoing" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
ongoing
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.board" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
board
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.update" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
update
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.delete" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
delete
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
Membership
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Membership">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership.is_owned_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
is_owned_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership.can_be_edited_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
can_be_edited_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership._remove_club_groups" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
_remove_club_groups
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership._add_club_groups" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
_add_club_groups
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Mailing" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
Mailing
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MailingSubscription" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
MailingSubscription
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../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_3" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_3" id="__nav_5_3_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_3_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_3">
|
|
<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_4" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_4" id="__nav_5_4_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_4_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_4">
|
|
<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/auth/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Auth
|
|
|
|
</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">
|
|
counter
|
|
|
|
</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>
|
|
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_6" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_6" id="__nav_5_6_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_6_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_6">
|
|
<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_7" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_7" id="__nav_5_7_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_7_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_7">
|
|
<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_8" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_8" id="__nav_5_8_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_8_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_8">
|
|
<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_9" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_9" id="__nav_5_9_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_9_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_9">
|
|
<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_10" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_10" id="__nav_5_10_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_10_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_10">
|
|
<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_11" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_11" id="__nav_5_11_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_11_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_11">
|
|
<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_12" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_12" id="__nav_5_12_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_12_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_12">
|
|
<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--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">
|
|
rootplace
|
|
|
|
</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>
|
|
rootplace
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../rootplace/models/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Models
|
|
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../rootplace/forms/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Forms
|
|
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../rootplace/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_14" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_14" id="__nav_5_14_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_14_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_14">
|
|
<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_15" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_15" id="__nav_5_15_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_15_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_15">
|
|
<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_16" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_16" id="__nav_5_16_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_16_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_16">
|
|
<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_17" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5_17" id="__nav_5_17_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_17_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5_17">
|
|
<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="#club.models.Club" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
Club
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Club">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.president" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
president
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.check_loop" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
check_loop
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.is_owned_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
is_owned_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.can_be_edited_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
can_be_edited_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.can_be_viewed_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
can_be_viewed_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Club.get_membership_for" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
get_membership_for
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
MembershipQuerySet
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="MembershipQuerySet">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.ongoing" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
ongoing
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.board" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
board
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.update" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
update
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MembershipQuerySet.delete" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
delete
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
Membership
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Membership">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership.is_owned_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
is_owned_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership.can_be_edited_by" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
can_be_edited_by
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership._remove_club_groups" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
_remove_club_groups
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Membership._add_club_groups" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
_add_club_groups
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.Mailing" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
Mailing
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#club.models.MailingSubscription" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
MailingSubscription
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="md-content" data-md-component="content">
|
|
<article class="md-content__inner md-typeset">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h1>Models</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="club.models.Club" class="doc doc-heading">
|
|
<code>Club</code>
|
|
|
|
|
|
<a href="#club.models.Club" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
<p class="doc doc-class-bases">
|
|
Bases: <code><span title="django.db.models.Model">Model</span></code></p>
|
|
|
|
|
|
<p>The Club class, made as a tree to allow nice tidy organization.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.Club.president" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">president</span><span class="p">()</span></code>
|
|
|
|
<a href="#club.models.Club.president" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Fetch the membership of the current president of this club.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-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></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-129"><a id="__codelineno-0-129" name="__codelineno-0-129"></a><span class="nd">@cached_property</span>
|
|
</span><span id="__span-0-130"><a id="__codelineno-0-130" name="__codelineno-0-130"></a><span class="k">def</span><span class="w"> </span><span class="nf">president</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Membership</span> <span class="o">|</span> <span class="kc">None</span><span class="p">:</span>
|
|
</span><span id="__span-0-131"><a id="__codelineno-0-131" name="__codelineno-0-131"></a><span class="w"> </span><span class="sd">"""Fetch the membership of the current president of this club."""</span>
|
|
</span><span id="__span-0-132"><a id="__codelineno-0-132" name="__codelineno-0-132"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">members</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span>
|
|
</span><span id="__span-0-133"><a id="__codelineno-0-133" name="__codelineno-0-133"></a> <span class="n">role</span><span class="o">=</span><span class="n">settings</span><span class="o">.</span><span class="n">SITH_CLUB_ROLES_ID</span><span class="p">[</span><span class="s2">"President"</span><span class="p">],</span> <span class="n">end_date</span><span class="o">=</span><span class="kc">None</span>
|
|
</span><span id="__span-0-134"><a id="__codelineno-0-134" name="__codelineno-0-134"></a> <span class="p">)</span><span class="o">.</span><span class="n">first</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="club.models.Club.check_loop" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">check_loop</span><span class="p">()</span></code>
|
|
|
|
<a href="#club.models.Club.check_loop" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Raise a validation error when a loop is found within the parent list.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-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>
|
|
<span class="normal"><a href="#__codelineno-0-143">143</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-144">144</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-136"><a id="__codelineno-0-136" name="__codelineno-0-136"></a><span class="k">def</span><span class="w"> </span><span class="nf">check_loop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
</span><span id="__span-0-137"><a id="__codelineno-0-137" name="__codelineno-0-137"></a><span class="w"> </span><span class="sd">"""Raise a validation error when a loop is found within the parent list."""</span>
|
|
</span><span id="__span-0-138"><a id="__codelineno-0-138" name="__codelineno-0-138"></a> <span class="n">objs</span> <span class="o">=</span> <span class="p">[]</span>
|
|
</span><span id="__span-0-139"><a id="__codelineno-0-139" name="__codelineno-0-139"></a> <span class="n">cur</span> <span class="o">=</span> <span class="bp">self</span>
|
|
</span><span id="__span-0-140"><a id="__codelineno-0-140" name="__codelineno-0-140"></a> <span class="k">while</span> <span class="n">cur</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-141"><a id="__codelineno-0-141" name="__codelineno-0-141"></a> <span class="k">if</span> <span class="n">cur</span> <span class="ow">in</span> <span class="n">objs</span><span class="p">:</span>
|
|
</span><span id="__span-0-142"><a id="__codelineno-0-142" name="__codelineno-0-142"></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 can not make loops in clubs"</span><span class="p">))</span>
|
|
</span><span id="__span-0-143"><a id="__codelineno-0-143" name="__codelineno-0-143"></a> <span class="n">objs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cur</span><span class="p">)</span>
|
|
</span><span id="__span-0-144"><a id="__codelineno-0-144" name="__codelineno-0-144"></a> <span class="n">cur</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">parent</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.Club.is_owned_by" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">is_owned_by</span><span class="p">(</span><span class="n">user</span><span class="p">)</span></code>
|
|
|
|
<a href="#club.models.Club.is_owned_by" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Method to see if that object can be super edited by the given user.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-190">190</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-191">191</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-192">192</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-193">193</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-194">194</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-190"><a id="__codelineno-0-190" name="__codelineno-0-190"></a><span class="k">def</span><span class="w"> </span><span class="nf">is_owned_by</span><span class="p">(</span><span class="bp">self</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="nb">bool</span><span class="p">:</span>
|
|
</span><span id="__span-0-191"><a id="__codelineno-0-191" name="__codelineno-0-191"></a><span class="w"> </span><span class="sd">"""Method to see if that object can be super edited by the given user."""</span>
|
|
</span><span id="__span-0-192"><a id="__codelineno-0-192" name="__codelineno-0-192"></a> <span class="k">if</span> <span class="n">user</span><span class="o">.</span><span class="n">is_anonymous</span><span class="p">:</span>
|
|
</span><span id="__span-0-193"><a id="__codelineno-0-193" name="__codelineno-0-193"></a> <span class="k">return</span> <span class="kc">False</span>
|
|
</span><span id="__span-0-194"><a id="__codelineno-0-194" name="__codelineno-0-194"></a> <span class="k">return</span> <span class="n">user</span><span class="o">.</span><span class="n">is_root</span> <span class="ow">or</span> <span class="n">user</span><span class="o">.</span><span class="n">is_board_member</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.Club.can_be_edited_by" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">can_be_edited_by</span><span class="p">(</span><span class="n">user</span><span class="p">)</span></code>
|
|
|
|
<a href="#club.models.Club.can_be_edited_by" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Method to see if that object can be edited by the given user.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-199">199</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-200">200</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-201">201</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-199"><a id="__codelineno-0-199" name="__codelineno-0-199"></a><span class="k">def</span><span class="w"> </span><span class="nf">can_be_edited_by</span><span class="p">(</span><span class="bp">self</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="nb">bool</span><span class="p">:</span>
|
|
</span><span id="__span-0-200"><a id="__codelineno-0-200" name="__codelineno-0-200"></a><span class="w"> </span><span class="sd">"""Method to see if that object can be edited by the given user."""</span>
|
|
</span><span id="__span-0-201"><a id="__codelineno-0-201" name="__codelineno-0-201"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">has_rights_in_club</span><span class="p">(</span><span class="n">user</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="club.models.Club.can_be_viewed_by" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">can_be_viewed_by</span><span class="p">(</span><span class="n">user</span><span class="p">)</span></code>
|
|
|
|
<a href="#club.models.Club.can_be_viewed_by" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Method to see if that object can be seen by the given user.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-203">203</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-204">204</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-205">205</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-203"><a id="__codelineno-0-203" name="__codelineno-0-203"></a><span class="k">def</span><span class="w"> </span><span class="nf">can_be_viewed_by</span><span class="p">(</span><span class="bp">self</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="nb">bool</span><span class="p">:</span>
|
|
</span><span id="__span-0-204"><a id="__codelineno-0-204" name="__codelineno-0-204"></a><span class="w"> </span><span class="sd">"""Method to see if that object can be seen by the given user."""</span>
|
|
</span><span id="__span-0-205"><a id="__codelineno-0-205" name="__codelineno-0-205"></a> <span class="k">return</span> <span class="n">user</span><span class="o">.</span><span class="n">was_subscribed</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.Club.get_membership_for" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">get_membership_for</span><span class="p">(</span><span class="n">user</span><span class="p">)</span></code>
|
|
|
|
<a href="#club.models.Club.get_membership_for" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Return the current membership the given user.</p>
|
|
|
|
|
|
<details class="note" open>
|
|
<summary>Note</summary>
|
|
<p>The result is cached.</p>
|
|
</details>
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-207">207</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-208">208</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-209">209</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-210">210</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-211">211</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-212">212</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-213">213</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-214">214</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-215">215</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-216">216</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-217">217</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-218">218</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-219">219</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-220">220</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-221">221</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-222">222</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-223">223</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-224">224</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-207"><a id="__codelineno-0-207" name="__codelineno-0-207"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_membership_for</span><span class="p">(</span><span class="bp">self</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">Membership</span> <span class="o">|</span> <span class="kc">None</span><span class="p">:</span>
|
|
</span><span id="__span-0-208"><a id="__codelineno-0-208" name="__codelineno-0-208"></a><span class="w"> </span><span class="sd">"""Return the current membership the given user.</span>
|
|
</span><span id="__span-0-209"><a id="__codelineno-0-209" name="__codelineno-0-209"></a>
|
|
</span><span id="__span-0-210"><a id="__codelineno-0-210" name="__codelineno-0-210"></a><span class="sd"> Note:</span>
|
|
</span><span id="__span-0-211"><a id="__codelineno-0-211" name="__codelineno-0-211"></a><span class="sd"> The result is cached.</span>
|
|
</span><span id="__span-0-212"><a id="__codelineno-0-212" name="__codelineno-0-212"></a><span class="sd"> """</span>
|
|
</span><span id="__span-0-213"><a id="__codelineno-0-213" name="__codelineno-0-213"></a> <span class="k">if</span> <span class="n">user</span><span class="o">.</span><span class="n">is_anonymous</span><span class="p">:</span>
|
|
</span><span id="__span-0-214"><a id="__codelineno-0-214" name="__codelineno-0-214"></a> <span class="k">return</span> <span class="kc">None</span>
|
|
</span><span id="__span-0-215"><a id="__codelineno-0-215" name="__codelineno-0-215"></a> <span class="n">membership</span> <span class="o">=</span> <span class="n">cache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="sa">f</span><span class="s2">"membership_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">_</span><span class="si">{</span><span class="n">user</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
|
</span><span id="__span-0-216"><a id="__codelineno-0-216" name="__codelineno-0-216"></a> <span class="k">if</span> <span class="n">membership</span> <span class="o">==</span> <span class="s2">"not_member"</span><span class="p">:</span>
|
|
</span><span id="__span-0-217"><a id="__codelineno-0-217" name="__codelineno-0-217"></a> <span class="k">return</span> <span class="kc">None</span>
|
|
</span><span id="__span-0-218"><a id="__codelineno-0-218" name="__codelineno-0-218"></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-219"><a id="__codelineno-0-219" name="__codelineno-0-219"></a> <span class="n">membership</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">members</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">user</span><span class="p">,</span> <span class="n">end_date</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span><span class="o">.</span><span class="n">first</span><span class="p">()</span>
|
|
</span><span id="__span-0-220"><a id="__codelineno-0-220" name="__codelineno-0-220"></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-221"><a id="__codelineno-0-221" name="__codelineno-0-221"></a> <span class="n">cache</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="sa">f</span><span class="s2">"membership_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">_</span><span class="si">{</span><span class="n">user</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"not_member"</span><span class="p">)</span>
|
|
</span><span id="__span-0-222"><a id="__codelineno-0-222" name="__codelineno-0-222"></a> <span class="k">else</span><span class="p">:</span>
|
|
</span><span id="__span-0-223"><a id="__codelineno-0-223" name="__codelineno-0-223"></a> <span class="n">cache</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="sa">f</span><span class="s2">"membership_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">_</span><span class="si">{</span><span class="n">user</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="n">membership</span><span class="p">)</span>
|
|
</span><span id="__span-0-224"><a id="__codelineno-0-224" name="__codelineno-0-224"></a> <span class="k">return</span> <span class="n">membership</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-class">
|
|
|
|
|
|
|
|
<h2 id="club.models.MembershipQuerySet" class="doc doc-heading">
|
|
<code>MembershipQuerySet</code>
|
|
|
|
|
|
<a href="#club.models.MembershipQuerySet" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
<p class="doc doc-class-bases">
|
|
Bases: <code><span title="django.db.models.QuerySet">QuerySet</span></code></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.MembershipQuerySet.ongoing" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">ongoing</span><span class="p">()</span></code>
|
|
|
|
<a href="#club.models.MembershipQuerySet.ongoing" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Filter all memberships which are not finished yet.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-231">231</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-232">232</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-233">233</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-231"><a id="__codelineno-0-231" name="__codelineno-0-231"></a><span class="k">def</span><span class="w"> </span><span class="nf">ongoing</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Self</span><span class="p">:</span>
|
|
</span><span id="__span-0-232"><a id="__codelineno-0-232" name="__codelineno-0-232"></a><span class="w"> </span><span class="sd">"""Filter all memberships which are not finished yet."""</span>
|
|
</span><span id="__span-0-233"><a id="__codelineno-0-233" name="__codelineno-0-233"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">Q</span><span class="p">(</span><span class="n">end_date</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">|</span> <span class="n">Q</span><span class="p">(</span><span class="n">end_date__gt</span><span class="o">=</span><span class="n">localdate</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="club.models.MembershipQuerySet.board" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">board</span><span class="p">()</span></code>
|
|
|
|
<a href="#club.models.MembershipQuerySet.board" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Filter all memberships where the user is/was in the board.</p>
|
|
<p>Be aware that users who were in the board in the past
|
|
are included, even if there are no more members.</p>
|
|
<p>If you want to get the users who are currently in the board,
|
|
mind combining this with the :meth:<code>ongoing</code> queryset method</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-235">235</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-236">236</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-237">237</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-238">238</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-239">239</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-240">240</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-241">241</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-242">242</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-243">243</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-244">244</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-235"><a id="__codelineno-0-235" name="__codelineno-0-235"></a><span class="k">def</span><span class="w"> </span><span class="nf">board</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Self</span><span class="p">:</span>
|
|
</span><span id="__span-0-236"><a id="__codelineno-0-236" name="__codelineno-0-236"></a><span class="w"> </span><span class="sd">"""Filter all memberships where the user is/was in the board.</span>
|
|
</span><span id="__span-0-237"><a id="__codelineno-0-237" name="__codelineno-0-237"></a>
|
|
</span><span id="__span-0-238"><a id="__codelineno-0-238" name="__codelineno-0-238"></a><span class="sd"> Be aware that users who were in the board in the past</span>
|
|
</span><span id="__span-0-239"><a id="__codelineno-0-239" name="__codelineno-0-239"></a><span class="sd"> are included, even if there are no more members.</span>
|
|
</span><span id="__span-0-240"><a id="__codelineno-0-240" name="__codelineno-0-240"></a>
|
|
</span><span id="__span-0-241"><a id="__codelineno-0-241" name="__codelineno-0-241"></a><span class="sd"> If you want to get the users who are currently in the board,</span>
|
|
</span><span id="__span-0-242"><a id="__codelineno-0-242" name="__codelineno-0-242"></a><span class="sd"> mind combining this with the :meth:`ongoing` queryset method</span>
|
|
</span><span id="__span-0-243"><a id="__codelineno-0-243" name="__codelineno-0-243"></a><span class="sd"> """</span>
|
|
</span><span id="__span-0-244"><a id="__codelineno-0-244" name="__codelineno-0-244"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">role__gt</span><span class="o">=</span><span class="n">settings</span><span class="o">.</span><span class="n">SITH_MAXIMUM_FREE_ROLE</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="club.models.MembershipQuerySet.update" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">update</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code>
|
|
|
|
<a href="#club.models.MembershipQuerySet.update" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Refresh the cache and edit group ownership.</p>
|
|
<p>Update the cache, when necessary, remove
|
|
users from club groups they are no more in
|
|
and add them in the club groups they should be in.</p>
|
|
<p>Be aware that this adds three db queries :
|
|
one to retrieve the updated memberships,
|
|
one to perform group removal and one to perform
|
|
group attribution.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-246">246</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-247">247</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-248">248</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-249">249</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-250">250</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-251">251</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-252">252</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-253">253</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-254">254</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-255">255</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-256">256</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-257">257</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-258">258</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-259">259</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-260">260</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-261">261</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-262">262</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-263">263</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-264">264</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-265">265</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-266">266</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-267">267</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-268">268</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-269">269</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-270">270</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-271">271</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-272">272</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-273">273</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-274">274</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-275">275</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-276">276</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-246"><a id="__codelineno-0-246" name="__codelineno-0-246"></a><span class="k">def</span><span class="w"> </span><span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span>
|
|
</span><span id="__span-0-247"><a id="__codelineno-0-247" name="__codelineno-0-247"></a><span class="w"> </span><span class="sd">"""Refresh the cache and edit group ownership.</span>
|
|
</span><span id="__span-0-248"><a id="__codelineno-0-248" name="__codelineno-0-248"></a>
|
|
</span><span id="__span-0-249"><a id="__codelineno-0-249" name="__codelineno-0-249"></a><span class="sd"> Update the cache, when necessary, remove</span>
|
|
</span><span id="__span-0-250"><a id="__codelineno-0-250" name="__codelineno-0-250"></a><span class="sd"> users from club groups they are no more in</span>
|
|
</span><span id="__span-0-251"><a id="__codelineno-0-251" name="__codelineno-0-251"></a><span class="sd"> and add them in the club groups they should be in.</span>
|
|
</span><span id="__span-0-252"><a id="__codelineno-0-252" name="__codelineno-0-252"></a>
|
|
</span><span id="__span-0-253"><a id="__codelineno-0-253" name="__codelineno-0-253"></a><span class="sd"> Be aware that this adds three db queries :</span>
|
|
</span><span id="__span-0-254"><a id="__codelineno-0-254" name="__codelineno-0-254"></a><span class="sd"> one to retrieve the updated memberships,</span>
|
|
</span><span id="__span-0-255"><a id="__codelineno-0-255" name="__codelineno-0-255"></a><span class="sd"> one to perform group removal and one to perform</span>
|
|
</span><span id="__span-0-256"><a id="__codelineno-0-256" name="__codelineno-0-256"></a><span class="sd"> group attribution.</span>
|
|
</span><span id="__span-0-257"><a id="__codelineno-0-257" name="__codelineno-0-257"></a><span class="sd"> """</span>
|
|
</span><span id="__span-0-258"><a id="__codelineno-0-258" name="__codelineno-0-258"></a> <span class="n">nb_rows</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
|
</span><span id="__span-0-259"><a id="__codelineno-0-259" name="__codelineno-0-259"></a> <span class="k">if</span> <span class="n">nb_rows</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
|
</span><span id="__span-0-260"><a id="__codelineno-0-260" name="__codelineno-0-260"></a> <span class="c1"># if no row was affected, no need to refresh the cache</span>
|
|
</span><span id="__span-0-261"><a id="__codelineno-0-261" name="__codelineno-0-261"></a> <span class="k">return</span> <span class="mi">0</span>
|
|
</span><span id="__span-0-262"><a id="__codelineno-0-262" name="__codelineno-0-262"></a>
|
|
</span><span id="__span-0-263"><a id="__codelineno-0-263" name="__codelineno-0-263"></a> <span class="n">cache_memberships</span> <span class="o">=</span> <span class="p">{}</span>
|
|
</span><span id="__span-0-264"><a id="__codelineno-0-264" name="__codelineno-0-264"></a> <span class="n">memberships</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="bp">self</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-265"><a id="__codelineno-0-265" name="__codelineno-0-265"></a> <span class="c1"># delete all User-Group relations and recreate the necessary ones</span>
|
|
</span><span id="__span-0-266"><a id="__codelineno-0-266" name="__codelineno-0-266"></a> <span class="c1"># It's more concise to write and more reliable</span>
|
|
</span><span id="__span-0-267"><a id="__codelineno-0-267" name="__codelineno-0-267"></a> <span class="n">Membership</span><span class="o">.</span><span class="n">_remove_club_groups</span><span class="p">(</span><span class="n">memberships</span><span class="p">)</span>
|
|
</span><span id="__span-0-268"><a id="__codelineno-0-268" name="__codelineno-0-268"></a> <span class="n">Membership</span><span class="o">.</span><span class="n">_add_club_groups</span><span class="p">(</span><span class="n">memberships</span><span class="p">)</span>
|
|
</span><span id="__span-0-269"><a id="__codelineno-0-269" name="__codelineno-0-269"></a> <span class="k">for</span> <span class="n">member</span> <span class="ow">in</span> <span class="n">memberships</span><span class="p">:</span>
|
|
</span><span id="__span-0-270"><a id="__codelineno-0-270" name="__codelineno-0-270"></a> <span class="n">cache_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"membership_</span><span class="si">{</span><span class="n">member</span><span class="o">.</span><span class="n">club_id</span><span class="si">}</span><span class="s2">_</span><span class="si">{</span><span class="n">member</span><span class="o">.</span><span class="n">user_id</span><span class="si">}</span><span class="s2">"</span>
|
|
</span><span id="__span-0-271"><a id="__codelineno-0-271" name="__codelineno-0-271"></a> <span class="k">if</span> <span class="n">member</span><span class="o">.</span><span class="n">end_date</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
|
</span><span id="__span-0-272"><a id="__codelineno-0-272" name="__codelineno-0-272"></a> <span class="n">cache_memberships</span><span class="p">[</span><span class="n">cache_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">member</span>
|
|
</span><span id="__span-0-273"><a id="__codelineno-0-273" name="__codelineno-0-273"></a> <span class="k">else</span><span class="p">:</span>
|
|
</span><span id="__span-0-274"><a id="__codelineno-0-274" name="__codelineno-0-274"></a> <span class="n">cache_memberships</span><span class="p">[</span><span class="n">cache_key</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"not_member"</span>
|
|
</span><span id="__span-0-275"><a id="__codelineno-0-275" name="__codelineno-0-275"></a> <span class="n">cache</span><span class="o">.</span><span class="n">set_many</span><span class="p">(</span><span class="n">cache_memberships</span><span class="p">)</span>
|
|
</span><span id="__span-0-276"><a id="__codelineno-0-276" name="__codelineno-0-276"></a> <span class="k">return</span> <span class="n">nb_rows</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.MembershipQuerySet.delete" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">delete</span><span class="p">()</span></code>
|
|
|
|
<a href="#club.models.MembershipQuerySet.delete" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Work just like the default Django's delete() method,
|
|
but add a cache invalidation for the elements of the queryset
|
|
before the deletion,
|
|
and a removal of the user from the club groups.</p>
|
|
<p>Be aware that this adds some db queries :</p>
|
|
<ul>
|
|
<li>1 to retrieve the deleted elements in order to perform
|
|
post-delete operations.
|
|
As we can't know if a delete will affect rows or not,
|
|
this query will always happen</li>
|
|
<li>1 query to remove the users from the club groups.
|
|
If the delete operation affected no row,
|
|
this query won't happen.</li>
|
|
</ul>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-278">278</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-279">279</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-280">280</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-281">281</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-282">282</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-283">283</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-284">284</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-285">285</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-286">286</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-287">287</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-288">288</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-289">289</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-290">290</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-291">291</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-292">292</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-293">293</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-294">294</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-295">295</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-296">296</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-297">297</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-298">298</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-299">299</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-300">300</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-301">301</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-302">302</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-303">303</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-304">304</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-278"><a id="__codelineno-0-278" name="__codelineno-0-278"></a><span class="k">def</span><span class="w"> </span><span class="nf">delete</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">]]:</span>
|
|
</span><span id="__span-0-279"><a id="__codelineno-0-279" name="__codelineno-0-279"></a><span class="w"> </span><span class="sd">"""Work just like the default Django's delete() method,</span>
|
|
</span><span id="__span-0-280"><a id="__codelineno-0-280" name="__codelineno-0-280"></a><span class="sd"> but add a cache invalidation for the elements of the queryset</span>
|
|
</span><span id="__span-0-281"><a id="__codelineno-0-281" name="__codelineno-0-281"></a><span class="sd"> before the deletion,</span>
|
|
</span><span id="__span-0-282"><a id="__codelineno-0-282" name="__codelineno-0-282"></a><span class="sd"> and a removal of the user from the club groups.</span>
|
|
</span><span id="__span-0-283"><a id="__codelineno-0-283" name="__codelineno-0-283"></a>
|
|
</span><span id="__span-0-284"><a id="__codelineno-0-284" name="__codelineno-0-284"></a><span class="sd"> Be aware that this adds some db queries :</span>
|
|
</span><span id="__span-0-285"><a id="__codelineno-0-285" name="__codelineno-0-285"></a>
|
|
</span><span id="__span-0-286"><a id="__codelineno-0-286" name="__codelineno-0-286"></a><span class="sd"> - 1 to retrieve the deleted elements in order to perform</span>
|
|
</span><span id="__span-0-287"><a id="__codelineno-0-287" name="__codelineno-0-287"></a><span class="sd"> post-delete operations.</span>
|
|
</span><span id="__span-0-288"><a id="__codelineno-0-288" name="__codelineno-0-288"></a><span class="sd"> As we can't know if a delete will affect rows or not,</span>
|
|
</span><span id="__span-0-289"><a id="__codelineno-0-289" name="__codelineno-0-289"></a><span class="sd"> this query will always happen</span>
|
|
</span><span id="__span-0-290"><a id="__codelineno-0-290" name="__codelineno-0-290"></a><span class="sd"> - 1 query to remove the users from the club groups.</span>
|
|
</span><span id="__span-0-291"><a id="__codelineno-0-291" name="__codelineno-0-291"></a><span class="sd"> If the delete operation affected no row,</span>
|
|
</span><span id="__span-0-292"><a id="__codelineno-0-292" name="__codelineno-0-292"></a><span class="sd"> this query won't happen.</span>
|
|
</span><span id="__span-0-293"><a id="__codelineno-0-293" name="__codelineno-0-293"></a><span class="sd"> """</span>
|
|
</span><span id="__span-0-294"><a id="__codelineno-0-294" name="__codelineno-0-294"></a> <span class="n">memberships</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">all</span><span class="p">())</span>
|
|
</span><span id="__span-0-295"><a id="__codelineno-0-295" name="__codelineno-0-295"></a> <span class="n">nb_rows</span><span class="p">,</span> <span class="n">rows_counts</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
|
|
</span><span id="__span-0-296"><a id="__codelineno-0-296" name="__codelineno-0-296"></a> <span class="k">if</span> <span class="n">nb_rows</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
|
|
</span><span id="__span-0-297"><a id="__codelineno-0-297" name="__codelineno-0-297"></a> <span class="n">Membership</span><span class="o">.</span><span class="n">_remove_club_groups</span><span class="p">(</span><span class="n">memberships</span><span class="p">)</span>
|
|
</span><span id="__span-0-298"><a id="__codelineno-0-298" name="__codelineno-0-298"></a> <span class="n">cache</span><span class="o">.</span><span class="n">set_many</span><span class="p">(</span>
|
|
</span><span id="__span-0-299"><a id="__codelineno-0-299" name="__codelineno-0-299"></a> <span class="p">{</span>
|
|
</span><span id="__span-0-300"><a id="__codelineno-0-300" name="__codelineno-0-300"></a> <span class="sa">f</span><span class="s2">"membership_</span><span class="si">{</span><span class="n">m</span><span class="o">.</span><span class="n">club_id</span><span class="si">}</span><span class="s2">_</span><span class="si">{</span><span class="n">m</span><span class="o">.</span><span class="n">user_id</span><span class="si">}</span><span class="s2">"</span><span class="p">:</span> <span class="s2">"not_member"</span>
|
|
</span><span id="__span-0-301"><a id="__codelineno-0-301" name="__codelineno-0-301"></a> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">memberships</span>
|
|
</span><span id="__span-0-302"><a id="__codelineno-0-302" name="__codelineno-0-302"></a> <span class="p">}</span>
|
|
</span><span id="__span-0-303"><a id="__codelineno-0-303" name="__codelineno-0-303"></a> <span class="p">)</span>
|
|
</span><span id="__span-0-304"><a id="__codelineno-0-304" name="__codelineno-0-304"></a> <span class="k">return</span> <span class="n">nb_rows</span><span class="p">,</span> <span class="n">rows_counts</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-class">
|
|
|
|
|
|
|
|
<h2 id="club.models.Membership" class="doc doc-heading">
|
|
<code>Membership</code>
|
|
|
|
|
|
<a href="#club.models.Membership" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
<p class="doc doc-class-bases">
|
|
Bases: <code><span title="django.db.models.Model">Model</span></code></p>
|
|
|
|
|
|
<p>The Membership class makes the connection between User and Clubs.</p>
|
|
|
|
|
|
<details class="both-users-and-clubs-can-have-many-membership-objects" open>
|
|
<summary>Both Users and Clubs can have many Membership objects</summary>
|
|
<ul>
|
|
<li>a user can be a member of many clubs at a time</li>
|
|
<li>a club can have many members at a time too</li>
|
|
</ul>
|
|
</details> <p>A User is currently member of all the Clubs where its Membership has an end_date set to null/None.
|
|
Otherwise, it's a past membership kept because it can be very useful to see who was in which Club in the past.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.Membership.is_owned_by" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">is_owned_by</span><span class="p">(</span><span class="n">user</span><span class="p">)</span></code>
|
|
|
|
<a href="#club.models.Membership.is_owned_by" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Method to see if that object can be super edited by the given user.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-378">378</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-379">379</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-380">380</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-381">381</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-382">382</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-378"><a id="__codelineno-0-378" name="__codelineno-0-378"></a><span class="k">def</span><span class="w"> </span><span class="nf">is_owned_by</span><span class="p">(</span><span class="bp">self</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="nb">bool</span><span class="p">:</span>
|
|
</span><span id="__span-0-379"><a id="__codelineno-0-379" name="__codelineno-0-379"></a><span class="w"> </span><span class="sd">"""Method to see if that object can be super edited by the given user."""</span>
|
|
</span><span id="__span-0-380"><a id="__codelineno-0-380" name="__codelineno-0-380"></a> <span class="k">if</span> <span class="n">user</span><span class="o">.</span><span class="n">is_anonymous</span><span class="p">:</span>
|
|
</span><span id="__span-0-381"><a id="__codelineno-0-381" name="__codelineno-0-381"></a> <span class="k">return</span> <span class="kc">False</span>
|
|
</span><span id="__span-0-382"><a id="__codelineno-0-382" name="__codelineno-0-382"></a> <span class="k">return</span> <span class="n">user</span><span class="o">.</span><span class="n">is_root</span> <span class="ow">or</span> <span class="n">user</span><span class="o">.</span><span class="n">is_board_member</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.Membership.can_be_edited_by" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">can_be_edited_by</span><span class="p">(</span><span class="n">user</span><span class="p">)</span></code>
|
|
|
|
<a href="#club.models.Membership.can_be_edited_by" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Check if that object can be edited by the given user.</p>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-384">384</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-385">385</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-386">386</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-387">387</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-388">388</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-389">389</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-384"><a id="__codelineno-0-384" name="__codelineno-0-384"></a><span class="k">def</span><span class="w"> </span><span class="nf">can_be_edited_by</span><span class="p">(</span><span class="bp">self</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="nb">bool</span><span class="p">:</span>
|
|
</span><span id="__span-0-385"><a id="__codelineno-0-385" name="__codelineno-0-385"></a><span class="w"> </span><span class="sd">"""Check if that object can be edited by the given user."""</span>
|
|
</span><span id="__span-0-386"><a id="__codelineno-0-386" name="__codelineno-0-386"></a> <span class="k">if</span> <span class="n">user</span><span class="o">.</span><span class="n">is_root</span> <span class="ow">or</span> <span class="n">user</span><span class="o">.</span><span class="n">is_board_member</span><span class="p">:</span>
|
|
</span><span id="__span-0-387"><a id="__codelineno-0-387" name="__codelineno-0-387"></a> <span class="k">return</span> <span class="kc">True</span>
|
|
</span><span id="__span-0-388"><a id="__codelineno-0-388" name="__codelineno-0-388"></a> <span class="n">membership</span> <span class="o">=</span> <span class="bp">self</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="n">user</span><span class="p">)</span>
|
|
</span><span id="__span-0-389"><a id="__codelineno-0-389" name="__codelineno-0-389"></a> <span class="k">return</span> <span class="n">membership</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">membership</span><span class="o">.</span><span class="n">role</span> <span class="o">>=</span> <span class="bp">self</span><span class="o">.</span><span class="n">role</span>
|
|
</span></code></pre></div></td></tr></table></div>
|
|
</details>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="club.models.Membership._remove_club_groups" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">_remove_club_groups</span><span class="p">(</span><span class="n">memberships</span><span class="p">)</span></code>
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-staticmethod"><code>staticmethod</code></small>
|
|
</span>
|
|
|
|
<a href="#club.models.Membership._remove_club_groups" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Remove users of those memberships from the club groups.</p>
|
|
<p>For example, if a user is in the Troll club board,
|
|
he is in the board group and the members group of the Troll.
|
|
After calling this function, he will be in neither.</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><span title="tuple">tuple</span>[<span title="int">int</span>, <span title="dict">dict</span>[<span title="str">str</span>, <span title="int">int</span>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The result of the deletion queryset.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-396">396</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-397">397</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-398">398</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-399">399</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-400">400</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-401">401</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-402">402</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-403">403</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-404">404</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-405">405</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-406">406</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-407">407</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-408">408</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-409">409</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-410">410</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-411">411</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-412">412</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-413">413</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-414">414</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-415">415</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-416">416</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-417">417</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-418">418</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-419">419</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-420">420</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-421">421</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-396"><a id="__codelineno-0-396" name="__codelineno-0-396"></a><span class="nd">@staticmethod</span>
|
|
</span><span id="__span-0-397"><a id="__codelineno-0-397" name="__codelineno-0-397"></a><span class="k">def</span><span class="w"> </span><span class="nf">_remove_club_groups</span><span class="p">(</span>
|
|
</span><span id="__span-0-398"><a id="__codelineno-0-398" name="__codelineno-0-398"></a> <span class="n">memberships</span><span class="p">:</span> <span class="n">Iterable</span><span class="p">[</span><span class="n">Membership</span><span class="p">],</span>
|
|
</span><span id="__span-0-399"><a id="__codelineno-0-399" name="__codelineno-0-399"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">]]:</span>
|
|
</span><span id="__span-0-400"><a id="__codelineno-0-400" name="__codelineno-0-400"></a><span class="w"> </span><span class="sd">"""Remove users of those memberships from the club groups.</span>
|
|
</span><span id="__span-0-401"><a id="__codelineno-0-401" name="__codelineno-0-401"></a>
|
|
</span><span id="__span-0-402"><a id="__codelineno-0-402" name="__codelineno-0-402"></a><span class="sd"> For example, if a user is in the Troll club board,</span>
|
|
</span><span id="__span-0-403"><a id="__codelineno-0-403" name="__codelineno-0-403"></a><span class="sd"> he is in the board group and the members group of the Troll.</span>
|
|
</span><span id="__span-0-404"><a id="__codelineno-0-404" name="__codelineno-0-404"></a><span class="sd"> After calling this function, he will be in neither.</span>
|
|
</span><span id="__span-0-405"><a id="__codelineno-0-405" name="__codelineno-0-405"></a>
|
|
</span><span id="__span-0-406"><a id="__codelineno-0-406" name="__codelineno-0-406"></a><span class="sd"> Returns:</span>
|
|
</span><span id="__span-0-407"><a id="__codelineno-0-407" name="__codelineno-0-407"></a><span class="sd"> The result of the deletion queryset.</span>
|
|
</span><span id="__span-0-408"><a id="__codelineno-0-408" name="__codelineno-0-408"></a>
|
|
</span><span id="__span-0-409"><a id="__codelineno-0-409" name="__codelineno-0-409"></a><span class="sd"> Warnings:</span>
|
|
</span><span id="__span-0-410"><a id="__codelineno-0-410" name="__codelineno-0-410"></a><span class="sd"> If this function isn't used in combination</span>
|
|
</span><span id="__span-0-411"><a id="__codelineno-0-411" name="__codelineno-0-411"></a><span class="sd"> with an actual deletion of the memberships,</span>
|
|
</span><span id="__span-0-412"><a id="__codelineno-0-412" name="__codelineno-0-412"></a><span class="sd"> it will result in an inconsistent state,</span>
|
|
</span><span id="__span-0-413"><a id="__codelineno-0-413" name="__codelineno-0-413"></a><span class="sd"> where users will be in the clubs, without</span>
|
|
</span><span id="__span-0-414"><a id="__codelineno-0-414" name="__codelineno-0-414"></a><span class="sd"> having the associated rights.</span>
|
|
</span><span id="__span-0-415"><a id="__codelineno-0-415" name="__codelineno-0-415"></a><span class="sd"> """</span>
|
|
</span><span id="__span-0-416"><a id="__codelineno-0-416" name="__codelineno-0-416"></a> <span class="n">clubs</span> <span class="o">=</span> <span class="p">{</span><span class="n">m</span><span class="o">.</span><span class="n">club_id</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><span id="__span-0-417"><a id="__codelineno-0-417" name="__codelineno-0-417"></a> <span class="n">users</span> <span class="o">=</span> <span class="p">{</span><span class="n">m</span><span class="o">.</span><span class="n">user_id</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><span id="__span-0-418"><a id="__codelineno-0-418" name="__codelineno-0-418"></a> <span class="n">groups</span> <span class="o">=</span> <span class="n">Group</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">Q</span><span class="p">(</span><span class="n">club__in</span><span class="o">=</span><span class="n">clubs</span><span class="p">)</span> <span class="o">|</span> <span class="n">Q</span><span class="p">(</span><span class="n">club_board__in</span><span class="o">=</span><span class="n">clubs</span><span class="p">))</span>
|
|
</span><span id="__span-0-419"><a id="__codelineno-0-419" name="__codelineno-0-419"></a> <span class="k">return</span> <span class="n">User</span><span class="o">.</span><span class="n">groups</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-420"><a id="__codelineno-0-420" name="__codelineno-0-420"></a> <span class="n">Q</span><span class="p">(</span><span class="n">group__in</span><span class="o">=</span><span class="n">groups</span><span class="p">)</span> <span class="o">&</span> <span class="n">Q</span><span class="p">(</span><span class="n">user__in</span><span class="o">=</span><span class="n">users</span><span class="p">)</span>
|
|
</span><span id="__span-0-421"><a id="__codelineno-0-421" name="__codelineno-0-421"></a> <span class="p">)</span><span class="o">.</span><span class="n">delete</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="club.models.Membership._add_club_groups" class="doc doc-heading">
|
|
<code class="highlight language-python"><span class="n">_add_club_groups</span><span class="p">(</span><span class="n">memberships</span><span class="p">)</span></code>
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-staticmethod"><code>staticmethod</code></small>
|
|
</span>
|
|
|
|
<a href="#club.models.Membership._add_club_groups" class="headerlink" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Add users of those memberships to the club groups.</p>
|
|
<p>For example, if a user just joined the Troll club board,
|
|
he will be added in both the members group and the board group
|
|
of the club.</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><span title="list">list</span>[<span title="core.models.User.groups.through">through</span>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The created User-Group relations.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<details class="quote">
|
|
<summary>Source code in <code>club/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-423">423</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-424">424</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-425">425</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-426">426</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-427">427</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-428">428</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-429">429</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-430">430</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-431">431</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-432">432</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-433">433</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-434">434</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-435">435</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-436">436</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-437">437</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-438">438</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-439">439</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-440">440</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-441">441</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-442">442</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-443">443</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-444">444</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-445">445</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-446">446</a></span>
|
|
<span class="normal"><a href="#__codelineno-0-447">447</a></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></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-423"><a id="__codelineno-0-423" name="__codelineno-0-423"></a><span class="nd">@staticmethod</span>
|
|
</span><span id="__span-0-424"><a id="__codelineno-0-424" name="__codelineno-0-424"></a><span class="k">def</span><span class="w"> </span><span class="nf">_add_club_groups</span><span class="p">(</span>
|
|
</span><span id="__span-0-425"><a id="__codelineno-0-425" name="__codelineno-0-425"></a> <span class="n">memberships</span><span class="p">:</span> <span class="n">Iterable</span><span class="p">[</span><span class="n">Membership</span><span class="p">],</span>
|
|
</span><span id="__span-0-426"><a id="__codelineno-0-426" name="__codelineno-0-426"></a><span class="p">)</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">groups</span><span class="o">.</span><span class="n">through</span><span class="p">]:</span>
|
|
</span><span id="__span-0-427"><a id="__codelineno-0-427" name="__codelineno-0-427"></a><span class="w"> </span><span class="sd">"""Add users of those memberships to the club groups.</span>
|
|
</span><span id="__span-0-428"><a id="__codelineno-0-428" name="__codelineno-0-428"></a>
|
|
</span><span id="__span-0-429"><a id="__codelineno-0-429" name="__codelineno-0-429"></a><span class="sd"> For example, if a user just joined the Troll club board,</span>
|
|
</span><span id="__span-0-430"><a id="__codelineno-0-430" name="__codelineno-0-430"></a><span class="sd"> he will be added in both the members group and the board group</span>
|
|
</span><span id="__span-0-431"><a id="__codelineno-0-431" name="__codelineno-0-431"></a><span class="sd"> of the club.</span>
|
|
</span><span id="__span-0-432"><a id="__codelineno-0-432" name="__codelineno-0-432"></a>
|
|
</span><span id="__span-0-433"><a id="__codelineno-0-433" name="__codelineno-0-433"></a><span class="sd"> Returns:</span>
|
|
</span><span id="__span-0-434"><a id="__codelineno-0-434" name="__codelineno-0-434"></a><span class="sd"> The created User-Group relations.</span>
|
|
</span><span id="__span-0-435"><a id="__codelineno-0-435" name="__codelineno-0-435"></a>
|
|
</span><span id="__span-0-436"><a id="__codelineno-0-436" name="__codelineno-0-436"></a><span class="sd"> Warnings:</span>
|
|
</span><span id="__span-0-437"><a id="__codelineno-0-437" name="__codelineno-0-437"></a><span class="sd"> If this function isn't used in combination</span>
|
|
</span><span id="__span-0-438"><a id="__codelineno-0-438" name="__codelineno-0-438"></a><span class="sd"> with an actual update/creation of the memberships,</span>
|
|
</span><span id="__span-0-439"><a id="__codelineno-0-439" name="__codelineno-0-439"></a><span class="sd"> it will result in an inconsistent state,</span>
|
|
</span><span id="__span-0-440"><a id="__codelineno-0-440" name="__codelineno-0-440"></a><span class="sd"> where users will have the rights associated to the</span>
|
|
</span><span id="__span-0-441"><a id="__codelineno-0-441" name="__codelineno-0-441"></a><span class="sd"> club, without actually being part of it.</span>
|
|
</span><span id="__span-0-442"><a id="__codelineno-0-442" name="__codelineno-0-442"></a><span class="sd"> """</span>
|
|
</span><span id="__span-0-443"><a id="__codelineno-0-443" name="__codelineno-0-443"></a> <span class="c1"># only active membership (i.e. `end_date=None`)</span>
|
|
</span><span id="__span-0-444"><a id="__codelineno-0-444" name="__codelineno-0-444"></a> <span class="c1"># grant the attribution of club groups.</span>
|
|
</span><span id="__span-0-445"><a id="__codelineno-0-445" name="__codelineno-0-445"></a> <span class="n">memberships</span> <span class="o">=</span> <span class="p">[</span><span class="n">m</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">memberships</span> <span class="k">if</span> <span class="n">m</span><span class="o">.</span><span class="n">end_date</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">]</span>
|
|
</span><span id="__span-0-446"><a id="__codelineno-0-446" name="__codelineno-0-446"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">memberships</span><span class="p">:</span>
|
|
</span><span id="__span-0-447"><a id="__codelineno-0-447" name="__codelineno-0-447"></a> <span class="k">return</span> <span class="p">[]</span>
|
|
</span><span id="__span-0-448"><a id="__codelineno-0-448" name="__codelineno-0-448"></a>
|
|
</span><span id="__span-0-449"><a id="__codelineno-0-449" name="__codelineno-0-449"></a> <span class="k">if</span> <span class="nb">sum</span><span class="p">(</span><span class="mi">1</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">memberships</span> <span class="k">if</span> <span class="ow">not</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="s2">"club"</span><span class="p">))</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span>
|
|
</span><span id="__span-0-450"><a id="__codelineno-0-450" name="__codelineno-0-450"></a> <span class="c1"># if more than one membership hasn't its `club` attribute set</span>
|
|
</span><span id="__span-0-451"><a id="__codelineno-0-451" name="__codelineno-0-451"></a> <span class="c1"># it's less expensive to reload the whole query with</span>
|
|
</span><span id="__span-0-452"><a id="__codelineno-0-452" name="__codelineno-0-452"></a> <span class="c1"># a select_related than perform a distinct query</span>
|
|
</span><span id="__span-0-453"><a id="__codelineno-0-453" name="__codelineno-0-453"></a> <span class="c1"># to fetch each club.</span>
|
|
</span><span id="__span-0-454"><a id="__codelineno-0-454" name="__codelineno-0-454"></a> <span class="n">ids</span> <span class="o">=</span> <span class="p">{</span><span class="n">m</span><span class="o">.</span><span class="n">id</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><span id="__span-0-455"><a id="__codelineno-0-455" name="__codelineno-0-455"></a> <span class="n">memberships</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span>
|
|
</span><span id="__span-0-456"><a id="__codelineno-0-456" name="__codelineno-0-456"></a> <span class="n">Membership</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">id__in</span><span class="o">=</span><span class="n">ids</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-457"><a id="__codelineno-0-457" name="__codelineno-0-457"></a> <span class="p">)</span>
|
|
</span><span id="__span-0-458"><a id="__codelineno-0-458" name="__codelineno-0-458"></a> <span class="n">club_groups</span> <span class="o">=</span> <span class="p">[]</span>
|
|
</span><span id="__span-0-459"><a id="__codelineno-0-459" name="__codelineno-0-459"></a> <span class="k">for</span> <span class="n">membership</span> <span class="ow">in</span> <span class="n">memberships</span><span class="p">:</span>
|
|
</span><span id="__span-0-460"><a id="__codelineno-0-460" name="__codelineno-0-460"></a> <span class="n">club_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
|
|
</span><span id="__span-0-461"><a id="__codelineno-0-461" name="__codelineno-0-461"></a> <span class="n">User</span><span class="o">.</span><span class="n">groups</span><span class="o">.</span><span class="n">through</span><span class="p">(</span>
|
|
</span><span id="__span-0-462"><a id="__codelineno-0-462" name="__codelineno-0-462"></a> <span class="n">user_id</span><span class="o">=</span><span class="n">membership</span><span class="o">.</span><span class="n">user_id</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_id</span><span class="o">=</span><span class="n">membership</span><span class="o">.</span><span class="n">club</span><span class="o">.</span><span class="n">members_group_id</span><span class="p">,</span>
|
|
</span><span id="__span-0-464"><a id="__codelineno-0-464" name="__codelineno-0-464"></a> <span class="p">)</span>
|
|
</span><span id="__span-0-465"><a id="__codelineno-0-465" name="__codelineno-0-465"></a> <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">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 class="p">:</span>
|
|
</span><span id="__span-0-467"><a id="__codelineno-0-467" name="__codelineno-0-467"></a> <span class="n">club_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
|
|
</span><span id="__span-0-468"><a id="__codelineno-0-468" name="__codelineno-0-468"></a> <span class="n">User</span><span class="o">.</span><span class="n">groups</span><span class="o">.</span><span class="n">through</span><span class="p">(</span>
|
|
</span><span id="__span-0-469"><a id="__codelineno-0-469" name="__codelineno-0-469"></a> <span class="n">user_id</span><span class="o">=</span><span class="n">membership</span><span class="o">.</span><span class="n">user_id</span><span class="p">,</span>
|
|
</span><span id="__span-0-470"><a id="__codelineno-0-470" name="__codelineno-0-470"></a> <span class="n">group_id</span><span class="o">=</span><span class="n">membership</span><span class="o">.</span><span class="n">club</span><span class="o">.</span><span class="n">board_group_id</span><span class="p">,</span>
|
|
</span><span id="__span-0-471"><a id="__codelineno-0-471" name="__codelineno-0-471"></a> <span class="p">)</span>
|
|
</span><span id="__span-0-472"><a id="__codelineno-0-472" name="__codelineno-0-472"></a> <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="n">User</span><span class="o">.</span><span class="n">groups</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">bulk_create</span><span class="p">(</span>
|
|
</span><span id="__span-0-474"><a id="__codelineno-0-474" name="__codelineno-0-474"></a> <span class="n">club_groups</span><span class="p">,</span> <span class="n">ignore_conflicts</span><span class="o">=</span><span class="kc">True</span>
|
|
</span><span id="__span-0-475"><a id="__codelineno-0-475" name="__codelineno-0-475"></a> <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="club.models.Mailing" class="doc doc-heading">
|
|
<code>Mailing</code>
|
|
|
|
|
|
<a href="#club.models.Mailing" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
<p class="doc doc-class-bases">
|
|
Bases: <code><span title="django.db.models.Model">Model</span></code></p>
|
|
|
|
|
|
<p>A Mailing list for a club.</p>
|
|
|
|
|
|
<details class="warning" open>
|
|
<summary>Warning</summary>
|
|
<p>Remember that mailing lists should be validated by UTBM.</p>
|
|
</details>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-class">
|
|
|
|
|
|
|
|
<h2 id="club.models.MailingSubscription" class="doc doc-heading">
|
|
<code>MailingSubscription</code>
|
|
|
|
|
|
<a href="#club.models.MailingSubscription" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-contents ">
|
|
<p class="doc doc-class-bases">
|
|
Bases: <code><span title="django.db.models.Model">Model</span></code></p>
|
|
|
|
|
|
<p>Link between user and mailing list.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</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="../../antispam/forms/" class="md-footer__link md-footer__link--prev" aria-label="Précédent: Forms">
|
|
<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">
|
|
Forms
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
|
|
|
|
<a href="../views/" class="md-footer__link md-footer__link--next" aria-label="Suivant: Views">
|
|
<div class="md-footer__title">
|
|
<span class="md-footer__direction">
|
|
Suivant
|
|
</span>
|
|
<div class="md-ellipsis">
|
|
Views
|
|
</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.f8cc74c7.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.c8b220af.min.js"></script>
|
|
|
|
|
|
</body>
|
|
</html> |