This repository has been archived on 2025-11-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
csmb-housewars/housewars/models/Award.py
2024-02-18 19:12:01 -06:00

15 lines
388 B
Python

from django.db import models
class Award(models.Model):
activity = models.ForeignKey(
'Activity', on_delete=models.CASCADE)
name = models.CharField(max_length=15)
points = models.IntegerField(default=0)
def __str__(self):
return f"{self.name}"
def save(self, *args, **kwargs):
self.full_clean()
return super().save(*args, **kwargs)