Skip to content

Commit

Permalink
Merge pull request #344 from brunoamaral/343-include-an-optional-desc…
Browse files Browse the repository at this point in the history
…ription-field-to-the-sources

343 include an optional description field to the sources
  • Loading branch information
brunoamaral authored Jul 17, 2023
2 parents 5a8e15d + ea0dba3 commit 9cf169f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions django/admin/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

# Initialize the router and register some endpoints
router = routers.DefaultRouter()
router.register(r'articles', ArticleViewSet)
router.register(r'authors', AuthorsViewSet)
router.register(r'categories', CategoryViewSet) # Register CategoryViewSet
router.register(r'sources', SourceViewSet)
Expand Down
2 changes: 1 addition & 1 deletion django/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Meta:
class SourceSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Sources
fields = ['name','source_id','source_for','link']
fields = ['name','description','source_id','source_for','link']

class AuthorSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
Expand Down
1 change: 1 addition & 0 deletions django/gregory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Sources(models.Model):
subject = models.ForeignKey(Subject,on_delete=models.PROTECT,null=True,blank=True,unique=False)
method = models.CharField(choices=METHODS, max_length=10, default='rss')
ignore_ssl = models.BooleanField(default=False)
description = models.TextField(blank=True, null=True)

def __str__(self):
return self.name
Expand Down

0 comments on commit 9cf169f

Please sign in to comment.