- getSeason() only for staff members

- new view staff()
- updated bootstrap to version 3.4.1
- updated jquery to 3.6.3
- changed container layout in main view 'matchday'
This commit is contained in:
Martin Bley
2023-04-02 21:24:20 +02:00
parent 446a55f3e5
commit 99eaafff00
11 changed files with 127 additions and 78 deletions

View File

@@ -17,9 +17,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TipPy. If not, see <http://www.gnu.org/licenses/>.
"""
from django.db import models
"""
from django.contrib.auth.models import User
from django.db import models
class UserProfile(models.Model):
user = models.OneToOneField(
@@ -30,14 +30,16 @@ class UserProfile(models.Model):
def __unicode__(self):
return self.user.username
class Competition(models.Model):
leagueShortcut = models.CharField(max_length=32)
leagueName = models.CharField(max_length=128)
season = models.CharField(max_length=4)
def __unicode__(self):
return(self.leagueShortcut)
return (self.leagueShortcut)
class Team(models.Model):
teamID = models.IntegerField(unique=True, primary_key=True)
@@ -50,12 +52,12 @@ class Team(models.Model):
return self.name
class Meta:
managed = True
app_label = 'tipp'
managed = True
app_label = 'tipp'
class Match(models.Model):
matchID = models.IntegerField(unique=True,primary_key=True)
matchID = models.IntegerField(unique=True, primary_key=True)
matchDateTime = models.DateTimeField()
group = models.IntegerField()
matchday = models.IntegerField()
@@ -77,6 +79,7 @@ class Match(models.Model):
def __unicode__(self):
return (str(self.matchID))
class Tipp(models.Model):
matchID = models.ForeignKey(
Match,
@@ -95,12 +98,15 @@ class Tipp(models.Model):
class Meta:
unique_together = ("matchID", "tipperID")
class Mandant(models.Model):
name = models.CharField(max_length=32, unique=True)
description = models.CharField(max_length=255)
def __unicode__(self):
return self.name
class Score(models.Model):
client = models.ForeignKey(
Mandant,
@@ -110,9 +116,11 @@ class Score(models.Model):
exact = models.PositiveSmallIntegerField()
diff = models.PositiveSmallIntegerField()
tendency = models.PositiveSmallIntegerField()
def __unicode__(self):
return str(self.client)
class chart(models.Model):
team = models.ForeignKey(
Team,
@@ -128,7 +136,8 @@ class chart(models.Model):
class Meta:
unique_together = ("team", "competition")
class RelUserMandant(models.Model):
user = models.ForeignKey(
User,
@@ -141,9 +150,11 @@ class RelUserMandant(models.Model):
class Meta:
unique_together = ("user", "mandant")
def __unicode__(self):
return (str(self.user) + " -> " + str(self.mandant))
class Post(models.Model):
content = models.TextField()
published = models.BooleanField(default=True)
@@ -152,13 +163,14 @@ class Post(models.Model):
User,
on_delete=models.CASCADE
)
class Meta:
ordering = ['-created']
def __unicode__(self):
return u'%s' % self.created
class RelPostMandant(models.Model):
post = models.ForeignKey(
Post,
@@ -171,6 +183,6 @@ class RelPostMandant(models.Model):
class Meta:
unique_together = ("post", "mandant")
def __unicode__(self):
return (str(self.post) + " -> " + str(self.mandant))