diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255---\351\231\266\345\206\266---\347\254\254\345\215\201\345\233\233\345\221\250\344\275\234\344\270\232 /\347\254\254\345\215\201\345\233\233\345\221\250_\347\254\254\344\270\211\350\212\202/models.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255---\351\231\266\345\206\266---\347\254\254\345\215\201\345\233\233\345\221\250\344\275\234\344\270\232 /\347\254\254\345\215\201\345\233\233\345\221\250_\347\254\254\344\270\211\350\212\202/models.py" new file mode 100644 index 0000000000000000000000000000000000000000..fcc1163402ea4c74a64c3004b27d946b03ede244 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255---\351\231\266\345\206\266---\347\254\254\345\215\201\345\233\233\345\221\250\344\275\234\344\270\232 /\347\254\254\345\215\201\345\233\233\345\221\250_\347\254\254\344\270\211\350\212\202/models.py" @@ -0,0 +1,19 @@ +from django.db import models + +# Create your models here. + + +class Question(models.Model): + question_text = models.CharField(max_length=200) + pub_date = models.DateTimeField('date published') + + def __str__(self): + return f"id:{self.id}, {self.name}" + + +class Choice(models.Model): + question = models.ForeignKey(Question, on_delete=models.CASCADE) + choice_text = models.CharField(max_length=200) + votes = models.IntegerField(default=0) + + diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255---\351\231\266\345\206\266---\347\254\254\345\215\201\345\233\233\345\221\250\344\275\234\344\270\232 /\347\254\254\345\215\201\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202/models.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255---\351\231\266\345\206\266---\347\254\254\345\215\201\345\233\233\345\221\250\344\275\234\344\270\232 /\347\254\254\345\215\201\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202/models.py" new file mode 100644 index 0000000000000000000000000000000000000000..dca237cff9f5db20d34c5227e80974f92cce2506 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_\351\231\266\345\206\266/3\347\217\255---\351\231\266\345\206\266---\347\254\254\345\215\201\345\233\233\345\221\250\344\275\234\344\270\232 /\347\254\254\345\215\201\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202/models.py" @@ -0,0 +1,28 @@ +from django.db import models + +# Create your models here. + + +class Question(models.Model): + question_text = models.CharField(max_length=200) + pub_date = models.DateTimeField('date published') + + +class Choice(models.Model): + question = models.ForeignKey(Question, on_delete=models.CASCADE) + choice_text = models.CharField(max_length=200) + votes = models.IntegerField(default=0) + + +class Student(models.Model): + #db_colum 为数据库中的字段 + student_id = models.AutoField(primary_key=True, db_column="id") + name = models.CharField(max_length=200) + +class Book(models.Model): + book_id = models.AutoField(primary_key=True, db_column="id") + book_name = models.CharField(max_length=200) + +class BorrowRecord(Student, Book): + _id = models.AutoField(primary_key=True, db_column="id") + borrow_time = models.DateTimeField(auto_now_add=True) \ No newline at end of file