Commit a53399fb authored by sbonnegent's avatar sbonnegent
Browse files

first version for models

parent 29ddbfb2
......@@ -41,6 +41,7 @@ INSTALLED_APPS = [
'compat',
'tournois',
'hijack_admin',
'django_extensions',
]
MIDDLEWARE = [
......
digraph model_graph {
// Dotfile by Django-Extensions graph_models
// Created: 2018-01-14 20:06
// Cli Options: tournois
fontname = "Helvetica"
fontsize = 8
splines = true
node [
fontname = "Helvetica"
fontsize = 8
shape = "plaintext"
]
edge [
fontname = "Helvetica"
fontsize = 8
]
// Labels
tournois_models_Tournoi [label=<
<TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0">
<TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4">
<FONT FACE="Helvetica Bold" COLOR="white">
Tournoi
</FONT></TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica Bold">id</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica Bold">AutoField</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT COLOR="#7B7B7B" FACE="Helvetica ">finished</FONT>
</TD><TD ALIGN="LEFT">
<FONT COLOR="#7B7B7B" FACE="Helvetica ">BooleanField</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica ">name</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica ">CharField</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT COLOR="#7B7B7B" FACE="Helvetica ">open_registration</FONT>
</TD><TD ALIGN="LEFT">
<FONT COLOR="#7B7B7B" FACE="Helvetica ">BooleanField</FONT>
</TD></TR>
</TABLE>
>]
tournois_models_Match [label=<
<TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0">
<TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4">
<FONT FACE="Helvetica Bold" COLOR="white">
Match
</FONT></TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica Bold">id</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica Bold">AutoField</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica Bold">follow</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica Bold">ForeignKey (id)</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica Bold">tournoi</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica Bold">ForeignKey (id)</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica Bold">user1</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica Bold">ForeignKey (id)</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica Bold">user2</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica Bold">ForeignKey (id)</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica ">stage</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica ">IntegerField</FONT>
</TD></TR>
<TR><TD ALIGN="LEFT" BORDER="0">
<FONT FACE="Helvetica ">state</FONT>
</TD><TD ALIGN="LEFT">
<FONT FACE="Helvetica ">CharField</FONT>
</TD></TR>
</TABLE>
>]
// Relations
django_contrib_auth_models_User [label=<
<TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0">
<TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4">
<FONT FACE="Helvetica Bold" COLOR="white">User</FONT>
</TD></TR>
</TABLE>
>]
tournois_models_Tournoi -> django_contrib_auth_models_User
[label="registered (tournoi)"] [arrowhead=dot arrowtail=dot, dir=both];
tournois_models_Match -> tournois_models_Tournoi
[label="tournoi (match)"] [arrowhead=none, arrowtail=dot, dir=both];
django_contrib_auth_models_User [label=<
<TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0">
<TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4">
<FONT FACE="Helvetica Bold" COLOR="white">User</FONT>
</TD></TR>
</TABLE>
>]
tournois_models_Match -> django_contrib_auth_models_User
[label="user1 (user1)"] [arrowhead=none, arrowtail=dot, dir=both];
django_contrib_auth_models_User [label=<
<TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0">
<TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4">
<FONT FACE="Helvetica Bold" COLOR="white">User</FONT>
</TD></TR>
</TABLE>
>]
tournois_models_Match -> django_contrib_auth_models_User
[label="user2 (user2)"] [arrowhead=none, arrowtail=dot, dir=both];
tournois_models_Match -> tournois_models_Match
[label="follow (match)"] [arrowhead=none, arrowtail=dot, dir=both];
}
......@@ -6,3 +6,4 @@ django-hijack
django-hijack-admin
Sphinx
sphinx-bootstrap-theme
django_extensions
......@@ -11,6 +11,7 @@ chardet==3.0.4 # via requests
click==6.7 # via pip-tools
django-compat==1.0.15
django-documentation==1.1
django-extensions==1.9.9
django-hijack-admin==2.1.6
django-hijack==2.1.6
django==2.0.1
......@@ -24,9 +25,10 @@ pip-tools==1.11.0
pygments==2.2.0 # via sphinx
pytz==2017.3 # via babel, django
requests==2.18.4 # via sphinx
six==1.11.0 # via django-compat, pip-tools, sphinx
six==1.11.0 # via django-compat, django-extensions, pip-tools, sphinx
snowballstemmer==1.2.1 # via sphinx
sphinx-bootstrap-theme==0.6.1
sphinx==1.6.6
sphinxcontrib-websupport==1.0.1 # via sphinx
typing==3.6.2 # via django-extensions
urllib3==1.22 # via requests
This diff is collapsed.
table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:8px;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th:active,table.dataTable thead>tr>td:active{outline:none}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;position:relative}table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{position:absolute;bottom:8px;right:8px;display:block;font-family:'Glyphicons Halflings';opacity:0.5}table.dataTable thead .sorting:after{opacity:0.2;content:"\e150"}table.dataTable thead .sorting_asc:after{content:"\e155"}table.dataTable thead .sorting_desc:after{content:"\e156"}table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{color:#eee}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.table-condensed>thead>tr>th{padding-right:20px}table.dataTable.table-condensed .sorting:after,table.dataTable.table-condensed .sorting_asc:after,table.dataTable.table-condensed .sorting_desc:after{top:6px;right:6px}table.table-bordered.dataTable{border-collapse:separate !important}table.table-bordered.dataTable th,table.table-bordered.dataTable td{border-left-width:0}table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable td:last-child,table.table-bordered.dataTable td:last-child{border-right-width:0}table.table-bordered.dataTable tbody th,table.table-bordered.dataTable tbody td{border-bottom-width:0}div.dataTables_scrollHead table.table-bordered{border-bottom-width:0}div.table-responsive>div.dataTables_wrapper>div.row{margin:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:first-child{padding-left:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:last-child{padding-right:0}
This diff is collapsed.
This diff is collapsed.
/*!
DataTables Bootstrap 3 integration
©2011-2015 SpryMedia Ltd - datatables.net/license
*/
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,e){a||(a=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(a,e).$;return b(e,a,a.document)}:b(jQuery,window,document)})(function(b,a,e){var d=b.fn.dataTable;b.extend(!0,d.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(d.ext.classes,
{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});d.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new d.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},f,g,p=0,q=function(d,e){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};
l=0;for(h=e.length;l<h;l++)if(c=e[l],b.isArray(c))q(d,c);else{g=f="";switch(c){case "ellipsis":f="&#x2026;";g="disabled";break;case "first":f=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":f=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":f=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":f=k.sLast;g=c+(j<n-1?"":" disabled");break;default:f=c+1,g=j===c?"active":""}f&&(i=b("<li>",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#",
"aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(f)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(e.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};d.TableTools&&(b.extend(!0,d.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},collection:{container:"DTTT_dropdown dropdown-menu",
buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,d.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}));return d});
This diff is collapsed.
This diff is collapsed.
{
"sProcessing": "Traitement en cours...",
"sSearch": "Rechercher&nbsp;:",
"sLengthMenu": "Afficher _MENU_ &eacute;l&eacute;ments",
"sInfo": "Affichage de l'&eacute;l&eacute;ment _START_ &agrave; _END_ sur _TOTAL_ &eacute;l&eacute;ments",
"sInfoEmpty": "Affichage de l'&eacute;l&eacute;ment 0 &agrave; 0 sur 0 &eacute;l&eacute;ment",
"sInfoFiltered": "(filtr&eacute; de _MAX_ &eacute;l&eacute;ments au total)",
"sInfoPostFix": "",
"sLoadingRecords": "Chargement en cours...",
"sZeroRecords": "Aucun &eacute;l&eacute;ment &agrave; afficher",
"sEmptyTable": "Aucune donn&eacute;e disponible dans le tableau",
"oPaginate": {
"sFirst": "Premier",
"sPrevious": "Pr&eacute;c&eacute;dent",
"sNext": "Suivant",
"sLast": "Dernier"
},
"oAria": {
"sSortAscending": ": activer pour trier la colonne par ordre croissant",
"sSortDescending": ": activer pour trier la colonne par ordre d&eacute;croissant"
}
}
from django.contrib import admin
from .models import Tournoi
from .models import Match
admin.site.register(Tournoi)
admin.site.register(Match)
# Generated by Django 2.0.1 on 2018-01-14 18:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Match',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('stage', models.IntegerField(default=0)),
('state', models.CharField(choices=[('1', 'en attente'), ('2', 'en cours'), ('3', 'terminé')], default='1', max_length=1)),
('follow', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='tournois.Match')),
],
options={
'ordering': ('tournoi', 'stage'),
},
),
migrations.CreateModel(
name='Tournoi',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('open_registration', models.BooleanField(default=False)),
('registered', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ('name',),
},
),
migrations.AddField(
model_name='match',
name='tournoi',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tournois.Tournoi'),
),
migrations.AddField(
model_name='match',
name='user1',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user1', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='match',
name='user2',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user2', to=settings.AUTH_USER_MODEL),
),
]
# Generated by Django 2.0.1 on 2018-01-14 20:06
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournois', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='tournoi',
name='finished',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='tournoi',
name='registered',
field=models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL),
),
]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment