Skip to content

Commit

Permalink
Merge pull request #182 from thenewboston-developers/API-updates
Browse files Browse the repository at this point in the history
Api updates(app slug,s3 public urls)
  • Loading branch information
ThaDeveloper authored Nov 11, 2021
2 parents 7acd71e + 3c8d954 commit 678f5a0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
AWS_S3_REGION_NAME = os.environ.get('S3_REGION_NAME')
AWS_S3_SIGNATURE_VERSION = 's3v4'
AWS_S3_FILE_OVERWRITE = False
AWS_QUERYSTRING_AUTH = False
AWS_DEFAULT_ACL = None
AWS_S3_VERIFY = True
env = os.getenv('ENVIRONMENT')
Expand Down
19 changes: 19 additions & 0 deletions v1/app_store/migrations/0004_app_slug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.1.1 on 2021-11-11 09:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app_store', '0003_auto_20211004_0505'),
]

operations = [
migrations.AddField(
model_name='app',
name='slug',
field=models.CharField(default='-', max_length=255),
preserve_default=False,
),
]
1 change: 1 addition & 0 deletions v1/app_store/models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class App(CreatedModified):
images = models.ManyToManyField('AppImage', blank=True, related_name='app_images')
tagline = models.CharField(max_length=255, blank=True, null=True)
category = models.ForeignKey('Category', null=True, blank=True, on_delete=models.SET_NULL)
slug = models.CharField(max_length=255)

def __str__(self):
return f'#{self.pk}: {self.name}'
Expand Down
4 changes: 2 additions & 2 deletions v1/app_store/serializers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class AppSerializer(ModelSerializer):

class Meta:
fields = ('pk', 'name', 'description', 'logo', 'website', 'images', 'tagline', 'category',
fields = ('pk', 'name', 'description', 'logo', 'website', 'images', 'tagline', 'category', 'slug',
'created_date', 'modified_date')
model = App
read_only_fields = ('created_date', 'modified_date',)
Expand All @@ -18,7 +18,7 @@ class Meta:
class AppSerializerCreate(ModelSerializer):

class Meta:
fields = ('pk', 'name', 'description', 'logo', 'website', 'images', 'tagline', 'category',
fields = ('pk', 'name', 'description', 'logo', 'website', 'images', 'tagline', 'category', 'slug',
'created_date', 'modified_date')
model = App
read_only_fields = ('created_date', 'modified_date',)
Expand Down

0 comments on commit 678f5a0

Please sign in to comment.