From 204f0f17b3b5bfea59779149f57fe7f89ee9b461 Mon Sep 17 00:00:00 2001 From: Sanjay Kumar Saini Date: Wed, 26 Jun 2024 18:00:01 +0000 Subject: [PATCH 1/2] Fix user prfile structure in admin panel --- .gitpod.yml | 10 ++++++++++ accounts/admin.py | 14 ++++---------- requirements.txt | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..b1c4d2b --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,10 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) +# and commit this file to your remote git repository to share the goodness with others. + +# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart + +tasks: + - init: pip install -r requirements.txt + + diff --git a/accounts/admin.py b/accounts/admin.py index 289de50..b427a92 100644 --- a/accounts/admin.py +++ b/accounts/admin.py @@ -3,13 +3,7 @@ from .models import User, UserProfile -class UserProfileInline(admin.StackedInline): - model = UserProfile - can_delete = False - verbose_name_plural = 'profile' - - -class UserAdmin(admin.ModelAdmin): - inlines = (UserProfileInline, ) - -admin.site.register(User, UserAdmin) \ No newline at end of file +# admin.site.register(User, UserAdmin) +class _structure(admin.ModelAdmin): + list_display = ( "user","phone" , "address") +admin.site.register(UserProfile , _structure) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index a19e7ab..3b941c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Django==2.2.13 Pillow==6.0.0 -pkg-resources==0.0.0 +# pkg-resources==0.0.0 pytz==2019.1 sqlparse==0.3.0 From 3c544fbe5af1eac44ca504c88a939dd3f8b1e15b Mon Sep 17 00:00:00 2001 From: Sanjay Kumar Saini Date: Wed, 26 Jun 2024 18:09:50 +0000 Subject: [PATCH 2/2] fix comment and post structure in admin panel --- chat/admin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chat/admin.py b/chat/admin.py index 5b77696..ae27bb7 100644 --- a/chat/admin.py +++ b/chat/admin.py @@ -2,5 +2,10 @@ from .models import Comment, Post -admin.site.register(Comment) -admin.site.register(Post) \ No newline at end of file +class _comment_structure(admin.ModelAdmin): + list_display=("user" , "text","comment_date" ) + +class _Post_structure(admin.ModelAdmin): + list_display=("user" , "text","picture" ) +admin.site.register(Comment , _comment_structure) +admin.site.register(Post , _Post_structure) \ No newline at end of file