Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2894ad3

Browse files
committed
allow clearing textbenefits via admin
1 parent69769b6 commit2894ad3

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

‎sponsors/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ def benefits_with_assets(self):
983983
return {str(b.id):bforbinbenefits}
984984

985985
deflookups(self,request,model_admin):
986-
return [(k,b.name)fork,binself.benefits_with_assets.items()]
986+
return [(k,f"{b.name} ({b.year})")fork,binself.benefits_with_assets.items()]
987987

988988
defqueryset(self,request,queryset):
989989
benefit=self.benefits_with_assets.get(self.value())
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.28 on 2024-05-09 20:37
2+
3+
fromdjango.dbimportmigrations,models
4+
5+
6+
classMigration(migrations.Migration):
7+
8+
dependencies= [
9+
('sponsors','0101_sponsor_linked_in_page_url'),
10+
]
11+
12+
operations= [
13+
migrations.AlterField(
14+
model_name='textasset',
15+
name='text',
16+
field=models.TextField(blank=True,default=''),
17+
),
18+
]

‎sponsors/models/assets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def value(self, value):
106106

107107

108108
classTextAsset(GenericAsset):
109-
text=models.TextField(default="")
109+
text=models.TextField(default="",blank=True)
110110

111111
def__str__(self):
112112
returnf"Text asset:{self.internal_name}"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp