Memo & Note - NokKbl/khubkhao-recommender GitHub Wiki
- Can create [name of file].py and test_[name of file].py in khubkhaoapp
in test file type ---> from django.test import TestCase and from khubkhaoapp.[name of file] import [name of method] then write test cases
- To use image from google drive in markdown
get field_id of image then replace [field_id] with the field_id ---> < img src="http:// drive.google.com/uc?export=view&id=[field_id]">
- About Waffle
Waffle has story point system, so, we will determine 1 story point for 4 hours to estimate time for each work.
- To use ManyToManyField relationships Field
class Food(models.Model):
food_name = models.CharField(max_length=50)
def __str__(self):
return self.food_name
class Category(models.Model):
category_name = models.CharField(max_length=128)
items = models.ManyToManyField(Food)
def __str__(self):
return self.category_name
- To setting postgresql for test in khunkhaoRec/setting.py
if 'test' in sys.argv:
DATABASES['default'] = {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'khubkhao_db',
'USER': 'postgres',
'PASSWORD': 'pxz',
'HOST': 'localhost'
}