Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added autocomplete fields for admin panel #636

Merged
merged 7 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions authentication/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ProfileAdmin(admin.ModelAdmin):

class WalletAdmin(admin.ModelAdmin):
list_display = ["pk", "wallet_type", "user_profile"]
autocomplete_fields = ["user_profile"]
search_fields = [
"user_profile__initial_context_id",
"wallet_type",
Expand All @@ -34,6 +35,7 @@ class WalletAdmin(admin.ModelAdmin):

class BrightIDConnectionAdmin(admin.ModelAdmin):
list_display = ["pk", "user_profile", "context_id", "age"]
autocomplete_fields = ["user_profile"]
search_fields = [
"context_id",
]
Expand All @@ -42,21 +44,25 @@ class BrightIDConnectionAdmin(admin.ModelAdmin):
class GitcoinPassportConnectionAdmin(admin.ModelAdmin):
list_display = ["pk", "user_profile", "user_wallet_address"]
search_fields = ["user_wallet_address", "user_profile__username"]
autocomplete_fields = ["user_profile"]


class TwitterConnectionAdmin(admin.ModelAdmin):
list_display = ["pk", "user_profile", "oauth_token"]
search_fields = ["user_profile__username", "oauth_token"]
autocomplete_fields = ["user_profile"]


class EnsConnectionAdmin(admin.ModelAdmin):
list_display = ["pk", "user_profile", "user_wallet_address"]
search_fields = ["user_profile__username", "user_wallet_address"]
autocomplete_fields = ["user_profile"]


class FarcasterConnectionAdmin(admin.ModelAdmin):
list_display = ["pk", "user_profile", "user_wallet_address"]
search_fields = ["user_profile__username", "user_wallet_address"]
autocomplete_fields = ["user_profile"]


admin.site.register(Wallet, WalletAdmin)
Expand Down
7 changes: 5 additions & 2 deletions prizetap/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@
class RaffleAdmin(admin.ModelAdmin):
list_display = ["pk", "name", "creator_name", "status"]
readonly_fields = ["vrf_tx_hash"]
autocomplete_fields = ["creator_profile"]


class RaffleٍEntryAdmin(admin.ModelAdmin):
class RaffleEntryAdmin(admin.ModelAdmin):
list_display = [
"pk",
"raffle",
"user_wallet_address",
"tx_hash",
"age",
]
autocomplete_fields = ["wallet_address"]


class LineaRaffleEntriesAdmin(admin.ModelAdmin):
list_display = ["pk", "wallet_address", "is_winner"]
autocomplete_fields = ["wallet_address"]


admin.site.register(Raffle, RaffleAdmin)
admin.site.register(RaffleEntry, RaffleٍEntryAdmin)
admin.site.register(RaffleEntry, RaffleEntryAdmin)
admin.site.register(Constraint, UserConstraintBaseAdmin)
admin.site.register(LineaRaffleEntries, LineaRaffleEntriesAdmin)
1 change: 1 addition & 0 deletions tokenTap/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class TokenDistributionClaimAdmin(admin.ModelAdmin):
]
search_fields = ["user_wallet_address"]
list_filter = ["token_distribution", "status"]
autocomplete_fields = ["user_profile"]


class GlobalSettingsAdmin(admin.ModelAdmin):
Expand Down
Loading