Fakultas Ilmu Komputer UI

Commit 684723e7 authored by RANI LASMA ULI's avatar RANI LASMA ULI
Browse files

Merge branch 'appendix-e' into 'master'

Latihan 10 - Automation

See merge request !12
parents fa59f1d4 2d7ffca0
Pipeline #27142 passed with stages
in 3 minutes and 52 seconds
web: gunicorn superlists.wsgi:application --log-file -
\ No newline at end of file
migrate: bash deployment.sh
web: bash run.sh
\ No newline at end of file
#!/bin/bash
python manage.py compilescss
python manage.py collectstatic --no-input
python manage.py makemigrations
python manage.py migrate
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-12-11 04:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('lists', '0003_auto_20191121_1714'),
]
operations = [
migrations.CreateModel(
name='List',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.AddField(
model_name='item',
name='list',
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='lists.List'),
),
migrations.AlterUniqueTogether(
name='item',
unique_together=set([('text', 'list')]),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-12-11 04:22
from __future__ import unicode_literals
from django.db import migrations
def find_dupes(apps, schema_editor):
List = apps.get_model("lists", "List")
for list_ in List.objects.all():
items = list_.item_set.all()
texts = set()
for ix, item in enumerate(items):
if item.text in texts:
item.text = '{} ({})'.format(item.text, ix)
item.save()
texts.add(item.text)
class Migration(migrations.Migration):
dependencies = [
('lists', '0004_auto_20191211_1120'),
]
operations = [
migrations.RunPython(find_dupes),
]
from django.db import models
class List(models.Model):
pass
class Item(models.Model):
text = models.TextField(blank=False)
\ No newline at end of file
text = models.TextField(blank=False)
list = models.ForeignKey(List,
default=None,
on_delete=models.CASCADE,
null=True)
class Meta:
unique_together = ('text', 'list')
astmonkey==0.3.6
bcrypt==3.1.7
cffi==1.13.2
chromedriver==2.24.1
coverage==4.5.4
cryptography==2.8
dj-database-url==0.5.0
Django==1.11.24
django-heroku==0.3.1
django-mutpy==0.1.2
fabric==2.5.0
gunicorn==19.9.0
invoke==1.3.0
isodate==0.6.0
Jinja2==2.10.3
MarkupSafe==1.1.1
MutPy==0.6.0
paramiko==2.7.1
psycopg2==2.8.3
psycopg2-binary==2.8.3
pycparser==2.19
pydot==1.4.1
PyNaCl==1.3.0
pyparsing==2.4.4
pytz==2019.2
PyYAML==5.1.2
rdflib==4.2.2
selenium==3.141.0
six==1.13.0
SPARQLWrapper==1.8.4
termcolor==1.1.0
urllib3==1.25.3
whitenoise==4.1.3
#!/bin/bash
python manage.py compilescss
python manage.py collectstatic --no-input
gunicorn superlists.wsgi:application --log-file -
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