-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- refactor django_jtables as a simple module for Django
- Loading branch information
1 parent
d3086fe
commit 42c1fcf
Showing
12 changed files
with
58 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from django.contrib import admin | ||
|
||
from .models import Student | ||
from student.models import Student | ||
|
||
# Register your models here. | ||
admin.site.register(Student) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,3 @@ | ||
from django.db import models | ||
|
||
from datetime import date | ||
|
||
# Create your models here. | ||
|
||
|
||
class Student(models.Model): | ||
def __str__(self): | ||
return self.name | ||
|
||
name = models.CharField(max_length=200) | ||
|
||
email_address = models.EmailField(max_length=200) | ||
|
||
password = models.CharField(max_length=200) | ||
|
||
class GenderChoices(models.TextChoices): | ||
MALE = "M", "Male" | ||
FEMALE = "F", "Female" | ||
OTHER = "O", "Other" | ||
|
||
gender = models.CharField( | ||
max_length=1, | ||
choices=GenderChoices.choices, | ||
) | ||
|
||
birth_date = models.DateField() | ||
|
||
class EducationChoices(models.TextChoices): | ||
PRIMARY = "1", "Primary school" | ||
HIGH_SCHOOL = "2", "High school" | ||
UNIVERSITY = "3", "University" | ||
|
||
education = models.CharField( | ||
max_length=1, | ||
choices=EducationChoices.choices, | ||
) | ||
|
||
about = models.TextField() | ||
|
||
is_active = models.BooleanField() | ||
|
||
# auto_now_add sets the DateTimeField to the datetime of when the object is created. | ||
record_date = models.DateTimeField(auto_now_add=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class StudentConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'student' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
class Student(models.Model): | ||
def __str__(self): | ||
return self.name | ||
|
||
name = models.CharField(max_length=200) | ||
|
||
email_address = models.EmailField(max_length=200) | ||
|
||
password = models.CharField(max_length=200) | ||
|
||
class GenderChoices(models.TextChoices): | ||
MALE = "M", "Male" | ||
FEMALE = "F", "Female" | ||
OTHER = "O", "Other" | ||
|
||
gender = models.CharField( | ||
max_length=1, | ||
choices=GenderChoices.choices, | ||
) | ||
|
||
birth_date = models.DateField() | ||
|
||
class EducationChoices(models.TextChoices): | ||
PRIMARY = "1", "Primary school" | ||
HIGH_SCHOOL = "2", "High school" | ||
UNIVERSITY = "3", "University" | ||
|
||
education = models.CharField( | ||
max_length=1, | ||
choices=EducationChoices.choices, | ||
) | ||
|
||
about = models.TextField() | ||
|
||
is_active = models.BooleanField() | ||
|
||
# auto_now_add sets the DateTimeField to the datetime of when the object is created. | ||
record_date = models.DateTimeField(auto_now_add=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters