Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Commit

Permalink
Updated link
Browse files Browse the repository at this point in the history
  • Loading branch information
enisbt committed Aug 17, 2018
1 parent 98737a9 commit 0f74947
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
24 changes: 24 additions & 0 deletions factlist/claims/migrations/0014_update_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.1 on 2018-08-17 20:04

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('claims', '0013_file_size_and_extension'),
]

operations = [
migrations.AddField(
model_name='link',
name='created_at',
field=models.DateTimeField(default=django.utils.timezone.now),
),
migrations.AddField(
model_name='link',
name='updated_at',
field=models.DateTimeField(blank=True, null=True),
),
]
2 changes: 2 additions & 0 deletions factlist/claims/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

class Link(models.Model):
link = models.CharField(max_length=255)
created_at = models.DateTimeField(default=timezone.now)
updated_at = models.DateTimeField(null=True, blank=True)

class Meta:
db_table = 'links'
Expand Down
2 changes: 1 addition & 1 deletion factlist/claims/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LinkSerializer(serializers.ModelSerializer):

class Meta:
model = Link
fields = ('id','link', 'embed')
fields = ('id','link', 'embed', 'created_at', 'updated_at')

def get_embed(self, link):
return cache.get(link.link)
Expand Down

0 comments on commit 0f74947

Please sign in to comment.