class Member(macaron.Model): team = macaron.ManyToOne(Team, "members") first_name = macaron.CharField(max_length=40) last_name = macaron.CharField(max_length=40) age = macaron.IntegerField(max=18, min=15, default=16, null=True) part = macaron.CharField(max_length=10) joined = macaron.TimestampAtCreate() modified = macaron.TimestampAtSave()
class Member(macaron.Model): team = macaron.ManyToOne(Team, related_name="members") first_name = macaron.CharField(max_length=20, null=True) last_name = macaron.CharField(max_length=20, null=True) part = macaron.CharField(max_length=10, null=True) age = macaron.IntegerField(null=True) def __str__(self): return "<Member '%s %s : %s'>" % (self.first_name, self.last_name, self.part)
class Team(macaron.Model): name = macaron.CharField(max_length=50) created = macaron.TimestampAtCreate() start_date = macaron.DateAtCreate() def __str__(self): return "<Team '%s'>" % self.name
class MyRecord(macaron.Model): name = macaron.CharField(max_length=20) value = StoreJSON() created = macaron.TimestampAtCreate() modified = macaron.TimestampAtSave() def __str__(self): return "<MyRecord '%s' is '%s'>" % (self.name, str(self.value))
class Member(macaron.Model): band = macaron.ManyToOne(Team, null=True, related_name="members", on_delete="SET NULL", on_update="CASCADE") first_name = macaron.CharField(max_length=20) last_name = macaron.CharField(max_length=20) part = macaron.CharField(max_length=10, null=True) code = macaron.CharField(length=6, null=True) age = macaron.IntegerField(max=18, min=15, default=16) created = macaron.TimestampAtCreate() joined = macaron.DateAtCreate() modified = macaron.TimestampAtSave() def __str__(self): return "<Member '%s %s : %s'>" % (self.first_name, self.last_name, self.part)
class Group(macaron.Model): name = macaron.CharField(max_length=20) series = macaron.ManyToOne(Series, related_name="groups")
class Movie(macaron.Model): title = macaron.CharField(max_length=20) class Group(macaron.Model):
class Series(macaron.Model): name = macaron.CharField(max_length=30) class Movie(macaron.Model): title = macaron.CharField(max_length=20)
class SubTitle(macaron.Model): title = macaron.CharField(max_length=30) movie = macaron.ManyToOne(Movie, related_name="subtitles", on_delete="CASCADE")
class Member(macaron.Model): curename = macaron.CharField(max_length=30) mygroup = macaron.ManyToOne(Group, related_name="mymembers") subgroup = macaron.ManyToOne(Group, related_name="submembers") movies = macaron.ManyToMany(Movie, related_name="members") joined = macaron.DateField()
class Challenges(macaron.Model): title = macaron.CharField() description = macaron.CharField() image_url = macaron.CharField() skill = macaron.ManyToOne(Skills, related_name="skill")
class Skills(macaron.Model): title = macaron.CharField() description = macaron.CharField() url = macaron.CharField() image_path = macaron.CharField()
class Team(macaron.Model): name = macaron.CharField(max_length=20) def __str__(self): return "<Team '%s'>" % self.name
class Song(macaron.Model): name = macaron.CharField(max_length=50) members = macaron.ManyToMany(Member, related_name="songs")