Compare commits
3 commits
9a2759bb21
...
84bf8b079a
Author | SHA1 | Date | |
---|---|---|---|
84bf8b079a | |||
73ec411384 | |||
0cdbccdd6e |
3 changed files with 11 additions and 5 deletions
|
@ -52,7 +52,7 @@ class PostAdmin(admin.ModelAdmin):
|
|||
"post_id",
|
||||
"source_site",
|
||||
"creator",
|
||||
"title",
|
||||
"title_at",
|
||||
"description_at",
|
||||
"mature",
|
||||
"date_created_fromated",
|
||||
|
@ -60,6 +60,14 @@ class PostAdmin(admin.ModelAdmin):
|
|||
"date_last_import_formated",
|
||||
]
|
||||
|
||||
@admin.display(description="Title")
|
||||
def title_at(self, obj):
|
||||
if obj.title.first() is not None:
|
||||
if len(str(obj.title.first().content)) >= 80:
|
||||
return obj.title.first().content[:77] + "..."
|
||||
else:
|
||||
return obj.title.first().content
|
||||
|
||||
@admin.display(description="Description")
|
||||
def description_at(self, obj):
|
||||
if len(str(obj.description.first().content)) >= 80:
|
||||
|
|
|
@ -17,7 +17,6 @@ from pathlib import Path
|
|||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
|
||||
|
||||
|
@ -29,7 +28,6 @@ DEBUG = True
|
|||
|
||||
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "northpaw.aroy.hs.tun"]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
|
@ -47,6 +45,7 @@ INSTALLED_APPS = [
|
|||
"corsheaders",
|
||||
"django_celery_results",
|
||||
"django_celery_beat",
|
||||
"sorl.thumbnail",
|
||||
# API apps
|
||||
"api",
|
||||
"api.schema",
|
||||
|
@ -54,7 +53,7 @@ INSTALLED_APPS = [
|
|||
"api.user",
|
||||
"api.posts",
|
||||
"api.creators",
|
||||
"images",
|
||||
# Apps for Backend logic
|
||||
"apps",
|
||||
"apps.archive",
|
||||
"apps.files",
|
||||
|
|
|
@ -21,5 +21,4 @@ from django.urls import include, path
|
|||
urlpatterns = [
|
||||
path("admin/", admin.site.urls),
|
||||
path("api/", include("api.urls")),
|
||||
path("", include("images.urls")),
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue