datafield

Define age in django template using actual datatime and birthday with datafield

若如初见. 提交于 2020-04-11 08:48:12
问题 i'm begginer at django and trying to display age for every user in my base of users. Here's my code: models.py: class Cv(models.Model): author = models.ForeignKey('auth.User') name = models.CharField(max_length=25, null = True) surname = models.CharField(max_length=25, null = True) address = models.CharField(max_length=100, blank=True) telephone = models.IntegerField() birth_date = models.DateField(blank=True, null=True) email = models.EmailField(max_length=50, null=True) skills = models

VARCHAR vs TEXT in MySQL

给你一囗甜甜゛ 提交于 2019-12-20 17:28:21
问题 I have two fields: one to store an excerpt with a max size of 500 characters, and another to store a description with a max size of 10,000 characters. What data types should I use, TEXT or VARCHAR ? And why? After MySQL 5.0.3 VARCHAR accepts ~65000 characters. But this does not tell why I should use one type and or the other. I'm reasoning that I should use VARCHAR for the excerpt because I can assign a size limit, and TEXT for the description field as it's larger. 回答1: A long VARCHAR is

VARCHAR vs TEXT in MySQL

痞子三分冷 提交于 2019-12-03 04:48:19
I have two fields: one to store an excerpt with a max size of 500 characters, and another to store a description with a max size of 10,000 characters. What data types should I use, TEXT or VARCHAR ? And why? After MySQL 5.0.3 VARCHAR accepts ~65000 characters. But this does not tell why I should use one type and or the other. I'm reasoning that I should use VARCHAR for the excerpt because I can assign a size limit, and TEXT for the description field as it's larger. A long VARCHAR is stored in the same manner as a TEXT / BLOB field in InnoDB (which I assume you're using for transactionality,