Fakultas Ilmu Komputer UI

Commit d4fb081d authored by Muzaki Azami's avatar Muzaki Azami
Browse files

Merge branch 'PBI-13-ProgressDietClient' into 'staging'

Pbi 13 progress diet client

See merge request !77
parents 726f232a 00f7d10c
Pipeline #80584 passed with stages
in 15 minutes and 1 second
# Generated by Django 3.1 on 2021-05-31 13:53
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('dietela_quiz', '0001_initial'),
('nutritionists', '0001_initial'),
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='CustomUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('name', models.CharField(max_length=100)),
('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
('is_staff', models.BooleanField(default=False)),
('is_active', models.BooleanField(default=True)),
('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
('deadline', models.DateField(default=django.utils.timezone.now)),
('diet_profile', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user', to='dietela_quiz.dietprofile')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('nutritionist', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='clients', to='nutritionists.nutritionist')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'abstract': False,
},
),
]
# Generated by Django 3.1 on 2021-06-01 08:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='customuser',
name='deadline',
field=models.DateField(null=True),
),
]
...@@ -14,7 +14,7 @@ class CustomUser(AbstractBaseUser, PermissionsMixin): ...@@ -14,7 +14,7 @@ class CustomUser(AbstractBaseUser, PermissionsMixin):
is_staff = models.BooleanField(default=False) is_staff = models.BooleanField(default=False)
is_active = models.BooleanField(default=True) is_active = models.BooleanField(default=True)
date_joined = models.DateTimeField(default=timezone.now) date_joined = models.DateTimeField(default=timezone.now)
deadline = models.DateField(default=timezone.now) deadline = models.DateField(null=True)
diet_profile = models.OneToOneField( diet_profile = models.OneToOneField(
DietProfile, DietProfile,
on_delete=models.CASCADE, on_delete=models.CASCADE,
......
...@@ -50,8 +50,8 @@ class CustomUserDetailsSerializer(serializers.ModelSerializer): ...@@ -50,8 +50,8 @@ class CustomUserDetailsSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = CustomUser model = CustomUser
fields = ('id', 'name', 'email',) fields = ('id', 'name', 'email','deadline')
read_only_fields = ('id', 'email',) read_only_fields = ('id', 'email','deadline')
class CustomLoginSerializer(LoginSerializer): class CustomLoginSerializer(LoginSerializer):
......
# Generated by Django 3.1 on 2021-05-31 13:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import multiselectfield.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('nutritionists', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='WeeklyReport',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('week_num', models.PositiveIntegerField()),
('weight', models.PositiveIntegerField()),
('height', models.PositiveIntegerField()),
('waist_size', models.PositiveIntegerField()),
('changes_felt', models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5')])),
('hunger_level', models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
('fullness_level', models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
('heavy_meal', models.IntegerField(choices=[(1, '1 kali'), (2, '2 kali'), (3, '3 kali'), (4, 'Lebih dari 3 kali')])),
('snacks', models.IntegerField(choices=[(1, 'Tidak pernah'), (2, '1 kali'), (3, '2 kali'), (4, '3 kali'), (5, 'Lebih dari 3 kali')])),
('sweet_beverages', models.IntegerField(choices=[(1, '0'), (2, '1'), (3, '2'), (4, '3'), (5, '4'), (6, 'Lebih dari 4')])),
('sugary_ingredients', models.IntegerField(choices=[(1, '0'), (2, '1'), (3, '2'), (4, '3'), (5, '4'), (6, 'Lebih dari 4')])),
('fried_snacks', models.IntegerField(choices=[(1, '0'), (2, '1'), (3, '2'), (4, '3'), (5, '4'), (6, 'Lebih dari 4')])),
('umami_snacks', models.IntegerField(choices=[(1, '0'), (2, '1'), (3, '2'), (4, '3'), (5, '4'), (6, 'Lebih dari 4')])),
('sweet_snacks', models.IntegerField(choices=[(1, '0'), (2, '1'), (3, '2'), (4, '3'), (5, '4'), (6, 'Lebih dari 4')])),
('fruits_portion', models.IntegerField(choices=[(1, '0'), (2, '1'), (3, '2'), (4, '3'), (5, '4'), (6, 'Lebih dari 4')])),
('vegetables_portion', models.IntegerField(choices=[(1, '0'), (2, '1'), (3, '2'), (4, '3'), (5, '4'), (6, 'Lebih dari 4')])),
('water_consumption', models.PositiveIntegerField()),
('physical_activity', multiselectfield.db.fields.MultiSelectField(choices=[(1, 'Hampir tidak pernah olahraga dan/atau duduk lebih dari 9 jam perhari'), (2, 'Jalan kaki santai'), (3, 'Jalan kaki cepat'), (4, 'Pemanasan'), (5, 'Naik turun tangga'), (6, 'Jogging'), (7, 'Treadmill'), (8, 'Senam Aerobic/cardio, Recovery/Scratching, Dance dll'), (9, 'Latihan penguatan otot (strength workout, weight workout)'), (10, 'Other')], max_length=20)),
('physical_activity_other', models.TextField()),
('time_for_activity', models.IntegerField(choices=[(1, '0 - 60 menit'), (2, '60 - 100 menit'), (3, '100 - 120 menit'), (4, '100 - 120 menit'), (5, '120 - 150 menit'), (6, '150 - 175 menit'), (7, '175 - 200 menit'), (8, '200 - 250 menit'), (9, 'Lebih dari 250 menit')])),
('feeling_rating', models.IntegerField(choices=[(1, 'Rasanya mau menyerah saja'), (2, 'Capek, susah, bosen, males, repot, sibuk'), (3, 'Biasa aja, meski ada kendala tapi semua bisa diatur'), (4, 'Lancar terus, semangat cukup stabil, gak ada masalah'), (5, 'Super seneng, semangat banget, worry-free lah')])),
('lesson_learned', models.TextField()),
('problem_faced_and_feedbacks', models.TextField()),
('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='weekly_report', to=settings.AUTH_USER_MODEL)),
('nutritionist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='weekly_report', to='nutritionists.nutritionist')),
],
),
migrations.CreateModel(
name='WeeklyReportComment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('weight', models.TextField()),
('height', models.TextField()),
('waist_size', models.TextField()),
('changes_felt', models.TextField()),
('hunger_level', models.TextField()),
('fullness_level', models.TextField()),
('heavy_meal', models.TextField()),
('snacks', models.TextField()),
('average_consumption', models.TextField()),
('water_consumption', models.TextField()),
('physical_activity', models.TextField()),
('time_for_activity', models.TextField()),
('feeling_rating', models.TextField()),
('lesson_learned', models.TextField()),
('problem_faced_and_feedbacks', models.TextField()),
('weekly_report', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='weekly_report_comment', to='diet_progress.weeklyreport')),
],
),
]
# Generated by Django 3.1 on 2021-05-31 13:53
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import multiselectfield.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='DietQuestionnaire',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('agree_to_all_statements_consent', models.IntegerField(blank=True, choices=[(1, 'Ya'), (2, 'Tidak')], null=True)),
('personal_data_consent', models.IntegerField(blank=True, choices=[(1, 'Ya'), (2, 'Tidak')], null=True)),
('general_purpose', models.IntegerField(blank=True, choices=[(1, 'Mencapai Body Goals'), (2, 'Mencapai Hidup Sehat Jangka Panjang')], null=True)),
('date_of_birth', models.DateField(blank=True, null=True)),
('city_and_area_of_residence', models.CharField(blank=True, max_length=200, null=True)),
('handphone_no', models.CharField(blank=True, max_length=50, null=True)),
('whatsapp_no', models.CharField(blank=True, max_length=50, null=True)),
('profession', models.IntegerField(blank=True, choices=[(1, 'Pegawai Swasta'), (2, 'PNS'), (3, 'Wirausaha'), (4, 'Self-Employed'), (5, 'Freelancer'), (6, 'Ibu Rumah Tangga'), (7, 'Mahasiswa'), (8, 'Pelajar (selain mahasiswa)'), (9, 'Lainnya')], null=True)),
('last_education', models.IntegerField(blank=True, choices=[(1, 'S2 atau S3'), (2, 'S1'), (3, 'SMA'), (4, 'SMP'), (5, 'SD'), (6, 'Lainnya')], null=True)),
('meal_preference', models.IntegerField(blank=True, choices=[(1, 'Tidak ada batasan'), (2, 'Halal'), (3, 'Vegetarian'), (4, 'Lacto-Ovo Vegetarian'), (5, 'Ovo-Vegetarian'), (6, 'Vegan')], null=True)),
('waist_size', models.PositiveIntegerField(blank=True, null=True)),
('dietary_change', models.IntegerField(blank=True, choices=[(1, 'Diet ketat'), (2, 'Dimulai dari perubahan bertahap saja dulu')], null=True)),
('has_weigher', models.IntegerField(blank=True, choices=[(1, 'Ya'), (2, 'Tidak')], null=True)),
('breakfast_frequency', models.IntegerField(blank=True, choices=[(1, 'Selalu'), (2, 'Kadang-Kadang'), (3, 'Tidak Pernah')], null=True)),
('breakfast_meal_type', models.IntegerField(blank=True, choices=[(1, 'Makanan yang ringan saja, hanya untuk mengganjal perut sebelum beraktivitas (misalnya: roti isi, cemilan tradisional seperti lontong, gorengan, atau kue-kue jajanan pasar)'), (2, 'Makanan yang mengenyangkan perut (nasi atau roti atau kentang dengan lauk-pauk)')], null=True)),
('sweet_tea_consumption_frequency', models.IntegerField(blank=True, choices=[(1, 'Tidak pernah'), (2, 'Sangat jarang'), (3, 'Tidak lebih dari 3 gelas per bulan'), (4, '1 gelas/minggu'), (5, '2 gelas atau lebih/minggu'), (6, 'Hampir setiap hari'), (7, '1 gelas (250 ml)/hari'), (8, '2 gelas (500 ml)/hari'), (9, 'Lebih dari 2 gelas/hari')], null=True)),
('coffee_consumption_frequency', models.IntegerField(blank=True, choices=[(1, 'Tidak pernah'), (2, 'Sangat jarang'), (3, 'Tidak lebih dari 3 gelas per bulan'), (4, '1 gelas/minggu'), (5, '2 gelas atau lebih/minggu'), (6, 'Hampir setiap hari'), (7, '1 gelas (250 ml)/hari'), (8, '2 gelas (500 ml)/hari'), (9, 'Lebih dari 2 gelas/hari')], null=True)),
('milk_consumption_frequency', models.IntegerField(blank=True, choices=[(1, 'Tidak pernah'), (2, 'Sangat jarang'), (3, 'Tidak lebih dari 3 gelas per bulan'), (4, '1 gelas/minggu'), (5, '2 gelas atau lebih/minggu'), (6, 'Hampir setiap hari'), (7, '1 gelas (250 ml)/hari'), (8, '2 gelas (500 ml)/hari'), (9, 'Lebih dari 2 gelas/hari')], null=True)),
('other_drink_consumption_frequency', models.IntegerField(blank=True, choices=[(1, 'Tidak pernah'), (2, 'Sangat jarang'), (3, 'Tidak lebih dari 3 gelas per bulan'), (4, '1 gelas/minggu'), (5, '2 gelas atau lebih/minggu'), (6, 'Hampir setiap hari'), (7, '1 gelas (250 ml)/hari'), (8, '2 gelas (500 ml)/hari'), (9, 'Lebih dari 2 gelas/hari')], null=True)),
('additional_sugar_in_a_day', models.IntegerField(blank=True, choices=[(1, 'Tidak pernah menggunakan gula tambahan'), (2, '1 sendok teh'), (3, '2 sendok teh'), (4, 'Lebih dari 2 sendok teh'), (5, '1 sendok makan'), (6, '2 sendok makan'), (7, 'Lebih dari 2 sendok makan')], null=True)),
('liquid_consumption_frequency', models.IntegerField(blank=True, choices=[(1, '8 gelas/hari atau 2 liter/hari'), (2, 'Kurang dari 8 gelas/hari atau kurang dari 2 liter/hari'), (3, 'Lebih dari 8 gelas/hari atau lebih dari 2 liter/hari')], null=True)),
('meal_consumed_almost_every_day', models.CharField(blank=True, max_length=200, null=True)),
('unliked_food', models.CharField(blank=True, max_length=200, null=True)),
('preferred_food_taste', models.CharField(blank=True, max_length=200, null=True)),
('expected_food_on_breakfast', models.CharField(blank=True, max_length=200, null=True)),
('expected_food_on_lunch_dinner', models.CharField(blank=True, max_length=200, null=True)),
('breakfast_meal_explanation', models.TextField(blank=True, null=True)),
('morning_snack_explanation', models.TextField(blank=True, null=True)),
('lunch_meal_explanation', models.TextField(blank=True, null=True)),
('evening_snack_explanation', models.TextField(blank=True, null=True)),
('dinner_meal_explanation', models.TextField(blank=True, null=True)),
('night_snack_explanation', models.TextField(blank=True, null=True)),
('food_alergies', models.CharField(blank=True, max_length=200, null=True)),
('diet_drinks', models.CharField(blank=True, max_length=200, null=True)),
('meal_provider', multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(1, 'Anggota keluarga'), (2, 'Asisten Rumah Tangga'), (3, 'Beli makanan di luar (beli langsung maupun delivery/pesan antar)'), (4, 'Dapat makanan di kantor'), (5, 'Saya Sendiri')], max_length=9, null=True)),
('cigarette_alcohol_condition', multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(1, 'Saat ini merokok'), (2, 'Pernah merokok tetapi sudah berhenti'), (3, 'Terkadang mengkonsumsi salah satu jenis minuman beralkohol (contoh: bir, vodka, wine)'), (4, 'Tidak termasuk salah satu diatas')], max_length=7, null=True)),
('multivitamin_tablet_suplement', models.CharField(blank=True, max_length=200, null=True)),
('physical_activity', multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(1, 'Hampir tidak pernah olahraga dan/atau duduk lebih dari 9 jam perhari'), (2, 'Jalan kaki santai'), (3, 'Jalan kaki cepat'), (4, 'Pemanasan'), (5, 'Naik turun tangga'), (6, 'Jogging'), (7, 'Treadmill'), (8, 'Senam Aerobic/cardio, Recovery/Scratching, Dance dll'), (9, 'Latihan penguatan otot (strength workout, weight workout)'), (10, 'Other')], max_length=20, null=True)),
('other_physical_activity', models.CharField(blank=True, max_length=200, null=True)),
('diet_and_life_style_story', models.TextField(blank=True, null=True)),
('disease', multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(1, 'Tidak ada'), (2, 'Diabetes Melitus Tipe II (Kencing Manis)'), (3, 'Diabetes Melitus Tipe I (Bawaan/Keturunan)'), (4, 'Gagal Ginjal Kronis Tingkat Akhir'), (5, 'Gagal Ginjal Kronis Tingkat 1-4'), (6, 'Penyakit Liver'), (7, 'Jantung Koroner'), (8, 'Kelainan Jantung Bawaan'), (9, 'Kelainan Ginjal Bawaan'), (10, 'Kanker'), (11, 'Maag'), (12, 'Tinggi kolesterol'), (13, 'Tinggi asam urat'), (14, 'Konstipasi'), (15, 'Anemia'), (16, 'Autoimun'), (17, 'Lupus'), (18, 'HIV/AIDS')], max_length=44, null=True)),
('complaint', multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(1, 'Tidak ada'), (2, 'Mual'), (3, 'Muntah'), (4, 'Susah buang air besar dalam 3 hari terakhir'), (5, 'Kesulitan mengunyah'), (6, 'Kesulitan menelan')], max_length=11, null=True)),
('regular_drug_consumption', models.TextField(blank=True, null=True)),
('other_disease', models.TextField(blank=True, null=True)),
('motivation_using_dietela', models.TextField(blank=True, null=True)),
('dietela_nutritionist_expectation', models.TextField(blank=True, null=True)),
('dietela_program_expectation', models.TextField(blank=True, null=True)),
('finished_steps', django.contrib.postgres.fields.ArrayField(base_field=models.PositiveIntegerField(), blank=True, default=list, null=True, size=None)),
('user', models.OneToOneField(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='diet_questionnaire', to=settings.AUTH_USER_MODEL)),
],
),
]
# Generated by Django 3.1 on 2021-05-31 13:53
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='DietelaProgram',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('unique_code', models.CharField(default='', max_length=255)),
('name', models.CharField(max_length=255)),
('price', models.FloatField()),
],
),
]
# Generated by Django 3.1 on 2021-05-31 13:53
from django.db import migrations, models
import django.db.models.deletion
import multiselectfield.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='DietProfile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('email', models.EmailField(max_length=100)),
('age', models.PositiveIntegerField()),
('weight', models.PositiveIntegerField()),
('height', models.PositiveIntegerField()),
('gender', models.IntegerField(choices=[(1, 'Laki-laki'), (2, 'Perempuan')])),
('special_condition', models.IntegerField(choices=[(1, 'Tidak ada'), (2, 'Hamil Trimester 1'), (3, 'Hamil Trimester 2'), (4, 'Hamil Trimester 3'), (5, 'Menyusui Bayi 0-6 Bulan'), (6, 'Menyusui Bayi 7-12 Bulan')])),
('body_activity', models.IntegerField(choices=[(1, 'Lebih banyak duduk dan tidak rutin olahraga'), (2, 'Banyak jalan, banyak bergerak, tetapi tidak rutin olahraga'), (3, 'Olahraga rutin 30-45 menit per hari'), (4, 'Olahraga rutin 45-60 menit per hari'), (5, 'Olahraga rutin lebih dari 60 menit per hari')])),
('vegetables_in_one_day', models.IntegerField(choices=[(1, '0 porsi'), (2, '1 porsi'), (3, '2 porsi'), (4, '3 porsi'), (5, 'Lebih dari 3 porsi')])),
('fruits_in_one_day', models.IntegerField(choices=[(1, '0 porsi'), (2, '1 porsi'), (3, '2 porsi'), (4, '3 porsi'), (5, 'Lebih dari 3 porsi')])),
('fried_food_in_one_day', models.IntegerField(choices=[(1, '0 potong'), (2, '1 potong'), (3, '2 potong'), (4, '3 potong'), (5, 'Lebih dari 3 potong')])),
('sweet_snacks_in_one_day', models.IntegerField(choices=[(1, '0 potong'), (2, '1 potong'), (3, '2 potong'), (4, '3 potong'), (5, 'Lebih dari 3 potong')])),
('sweet_drinks_in_one_day', models.IntegerField(choices=[(1, '0 gelas'), (2, '1 gelas'), (3, '2 gelas'), (4, '3 gelas'), (5, 'Lebih dari 3 gelas')])),
('packaged_food_in_one_day', models.IntegerField(choices=[(1, '0 porsi'), (2, '1 porsi'), (3, '2 porsi'), (4, '3 porsi'), (5, 'Lebih dari 3 porsi')])),
('large_meal_in_one_day', models.IntegerField(choices=[(1, '1 kali'), (2, '2 kali'), (3, '3 kali'), (4, 'Lebih dari 3 kali')])),
('snacks_in_one_day', models.IntegerField(choices=[(1, 'Tidak pernah'), (2, '1 kali'), (3, '2 kali'), (4, '3 kali'), (5, 'Lebih dari 3 kali')])),
('breakfast_type', models.IntegerField(choices=[(1, 'Tidak pernah makan pagi'), (2, 'Makanan yang ringan saja'), (3, 'Makanan yang sampai mengenyangkan perut')])),
('current_condition', models.IntegerField(choices=[(1, 'Saya belum tertarik melakukan diet dan gaya hidup sehat dan tidak tahu kondisi gizi serta kesehatan saya'), (2, 'Saya belum tertarik melakukan diet dan gaya hidup sehat meskipun saya tahu kondisi gizi dan kesehatan saya'), (3, 'Saya mulai tertarik melakukan diet dan gaya hidup sehat meskipun saya tidak tahu kondisi gizi dan kesehatan saya'), (4, 'Saya mulai tertarik melakukan diet dan gaya hidup sehat dan tahu kondisi gizi dan kesehatan saya'), (5, 'Saya sudah tahu manfaat diet dan gaya hidup sehat namun belum tahu harus mulai menerapkannya dari mana'), (6, 'Saya sudah pernah merubah diet dan gaya hidup menjadi lebih sehat tetapi tidak bertahan lama (dilakukan kurang dari 6 bulan)'), (7, 'Saya sudah pernah berhasil menjalani diet dan gaya hidup sehat selama lebih dari 6 bulan dan ingin melakukannya lagi')])),
('problem_to_solve', models.IntegerField(choices=[(1, 'Turun berat badan dengan target yang realistis'), (2, 'Naik berat badan dengan target yang realistis'), (3, 'Berat badan yang bertahan permanen, menjaga agar berat badan tidak naik, anti yo-yo diet'), (4, 'Butuh pengaturan gizi Ibu Hamil'), (5, 'Butuh pengaturan gizi Ibu Menyusui'), (6, 'Menyiapkan tubuh untuk mencapai kesuburan dan persiapan kehamilan'), (7, 'Mengatur gula darah tinggi (Pre-diabetes), hiperlipidemia (kolesterol), hipertensi (tekanan darah tinggi)'), (8, 'Capai pola makan sehat dan tetap enjoy menikmati makanan yang disukai'), (9, 'Transisi vegan'), (10, ' Butuh pengaturan gizi pada anak-anak atau remaja')])),
('health_problem', multiselectfield.db.fields.MultiSelectField(choices=[(1, 'Tidak ada yang perlu dikhawatirkan'), (2, 'Diabetes Tipe 2'), (3, 'Diabetes Tipe 1'), (4, 'PCOS (Polycystic Ovary Syndrome)'), (5, 'Kolesterol tinggi'), (6, 'Asam urat tinggi'), (7, 'Tekanan darah tinggi'), (8, 'Gula darah tinggi'), (9, 'Kanker'), (10, 'HIV/AIDS'), (11, 'Maag/GERD/Dispepsia/Gangguan lambung'), (12, 'Penyintas Kanker'), (13, 'Penyakit Kronis Lainnya')], max_length=29)),
],
),
migrations.CreateModel(
name='QuizResult',
fields=[
('diet_profile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='quiz_result', serialize=False, to='dietela_quiz.dietprofile')),
('age', models.PositiveIntegerField()),
('weight', models.PositiveIntegerField()),
('height', models.PositiveIntegerField()),
('gender', models.IntegerField(choices=[(1, 'Laki-laki'), (2, 'Perempuan')])),
('body_mass_index', models.PositiveIntegerField()),
('nutrition_status', models.CharField(max_length=100)),
('ideal_weight_range', models.JSONField()),
('daily_energy_needs', models.FloatField()),
('daily_nutrition_needs', models.JSONField()),
('vegetable_and_fruit_sufficiency', models.CharField(max_length=100)),
('vegetable_and_fruit_diet_recommendation', models.TextField()),
('sugar_salt_fat_problem', models.CharField(max_length=100)),
('sugar_salt_fat_diet_recommendation', models.TextField()),
('large_meal_diet_recommendation', models.TextField()),
('snacks_diet_recommendation', models.TextField()),
('breakfast_recommendation', models.TextField()),
('energy_needed_per_dine', models.JSONField()),
('physical_activity_recommendation', models.TextField()),
('program_recommendation', models.JSONField()),
],
),
]
# Generated by Django 3.1 on 2021-05-31 13:53
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Nutritionist',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('full_name_and_degree', models.CharField(max_length=255)),
('registration_certificate_no', models.CharField(max_length=255)),
('university', models.CharField(max_length=255)),
('mastered_nutritional_problems', models.TextField()),
('handled_age_group', models.TextField()),
('another_practice_place', models.CharField(max_length=255)),
('languages', models.CharField(max_length=255)),
('profile_picture', models.ImageField(null=True, upload_to='nutritionist')),
],
),
]
# Generated by Django 3.1 on 2021-05-31 13:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('nutritionists', '0001_initial'),
('dietela_program', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Cart',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('transaction_status', models.CharField(choices=[('success', 'Success'), ('pending', 'Pending'), ('unpaid', 'Unpaid'), ('error', 'Error')], default='unpaid', max_length=128)),
('program_end_date', models.DateField(blank=True, null=True)),
('nutritionist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nutritionists.nutritionist')),
('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dietela_program.dietelaprogram')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cart', to=settings.AUTH_USER_MODEL)),
],
),
]
# Generated by Django 3.1 on 2021-05-31 13:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('nutritionists', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='DietRecommendation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('client_plan_meal', models.FileField(blank=True, null=True, upload_to='diet-recommendation')),
('nutritional_advice', models.TextField(blank=True, null=True)),
('lifestyle_advice', models.TextField(blank=True, null=True)),
('client', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='diet_recommendation', to=settings.AUTH_USER_MODEL)),
('nutritionist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='diet_recommendation', to='nutritionists.nutritionist')),
],
),
]
...@@ -101,7 +101,7 @@ class GetProfilesAndCSVTest(APITestCase): ...@@ -101,7 +101,7 @@ class GetProfilesAndCSVTest(APITestCase):
email='test@test.com', email='test@test.com',
password='abc', password='abc',
diet_profile=cls.diet_profile_1, diet_profile=cls.diet_profile_1,
nutritionist=cls.nutritionist nutritionist=cls.nutritionist,
) )
cls.custom_user_2 = CustomUser.objects.create_user( cls.custom_user_2 = CustomUser.objects.create_user(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment