Add models
This commit is contained in:
parent
386013b137
commit
ce6a169259
@ -0,0 +1 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
17
apps/tbde/admin.py
Normal file
17
apps/tbde/admin.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from tbde.models import Ticket, Reward
|
||||
|
||||
|
||||
@admin.register(Ticket)
|
||||
class TicketAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(Reward)
|
||||
class RewardAdmin(admin.ModelAdmin):
|
||||
pass
|
@ -0,0 +1,8 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class TBDEConfig(AppConfig):
|
||||
name = 'tbde'
|
||||
verbose_name = _('tombola')
|
@ -0,0 +1,37 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
|
||||
from django.db import models
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class Ticket(models.Model):
|
||||
number = models.PositiveIntegerField(
|
||||
verbose_name=_("number")
|
||||
)
|
||||
|
||||
note = models.CharField(
|
||||
max_length=255,
|
||||
verbose_name=_("note")
|
||||
)
|
||||
|
||||
|
||||
class Reward(models.Model):
|
||||
order = models.PositiveIntegerField(
|
||||
verbose_name=_("order"),
|
||||
)
|
||||
|
||||
name = models.CharField(
|
||||
max_length=255,
|
||||
verbose_name=_("name"),
|
||||
)
|
||||
|
||||
image = models.ImageField(
|
||||
verbose_name=_("image"),
|
||||
)
|
||||
|
||||
rewarded_by = models.ForeignKey(
|
||||
Ticket,
|
||||
on_delete=models.PROTECT,
|
||||
verbose_name=_("rewarded by")
|
||||
)
|
@ -0,0 +1 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
@ -1,10 +1,6 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from django.http import HttpResponseRedirect
|
||||
|
||||
from urllib.parse import urlencode, parse_qs, urlsplit, urlunsplit
|
||||
|
||||
|
||||
class TurbolinksMiddleware(object):
|
||||
"""
|
||||
|
@ -1,3 +1,5 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
########################
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
########################
|
||||
|
@ -1,3 +1,5 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
|
||||
"""tombola URL Configuration
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
|
@ -1,3 +1,5 @@
|
||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||
|
||||
"""
|
||||
WSGI config for tombola project.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user