Fakultas Ilmu Komputer UI

Commit bde214e6 authored by Nabila Febri Viola's avatar Nabila Febri Viola
Browse files

[REFACTOR] Removes uuid field

parent 04ff52c7
Pipeline #48885 passed with stages
in 1 minute and 45 seconds
......@@ -7,7 +7,7 @@ from acara_donor.filters import AcaraDonorFilter
class AcaraDonorAdmin(admin.ModelAdmin):
list_filter = ('status', AcaraDonorFilter, 'kecamatan', 'kategori')
search_fields = ('waktu_mulai',)
readonly_fields = ('nomor',
readonly_fields = ('id',
'user',
'nama_institusi',
'alamat_institusi',
......
......@@ -14,7 +14,6 @@ class AcaraDonorFactory(factory.DjangoModelFactory):
class Meta:
model = AcaraDonor
nomor = factory.Faker('uuid4')
user = factory.SubFactory(UserFactory)
status = factory.Faker('boolean', chance_of_getting_true=66)
......
# Generated by Django 3.0.5 on 2020-06-01 19:27
# Generated by Django 3.0.5 on 2020-06-02 00:45
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
......@@ -19,7 +18,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='AcaraDonor',
fields=[
('nomor', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status', models.BooleanField(null=True)),
('nama_institusi', models.CharField(max_length=95)),
('alamat_institusi', models.CharField(max_length=140)),
......
......@@ -3,11 +3,9 @@ from django.core.validators import MinValueValidator
from django.utils.timezone import localtime
from main.models import User
from donor.models import JadwalDonor
import uuid
class AcaraDonor(models.Model):
nomor = models.UUIDField(primary_key=True, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE)
status = models.BooleanField(null=True)
......
......@@ -25,5 +25,5 @@ class AcaraDonorSerializer(serializers.ModelSerializer):
class Meta:
model = AcaraDonor
exclude = ["user", "nomor", "status"]
exclude = ["user", "status"]
extra_kwargs = {'foto_lokasi': {'required': False}}
Supports Markdown
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