Browse Source

Merge pull request #63 from BridgeCityBicycleCoop/feature/upgrade-admin-visits

A few chores
master
Drew Larson 7 years ago
committed by GitHub
parent
commit
6c93c52be0
  1. 14
      bikeshop_project/core/admin.py
  2. 4
      bikeshop_project/registration/models.py
  3. 20
      requirements/base.txt

14
bikeshop_project/core/admin.py

@ -7,5 +7,17 @@ admin.site.register([Membership, Payment])
@admin.register(Visit)
class VisitAdmin(admin.ModelAdmin):
list_select_related = ('member',)
fields = ('member', 'purpose', 'created_at')
ordering = ('created_at',)
list_display = ('member', 'purpose', 'created_at')
list_display = ('full_name', 'purpose', 'created_at')
list_filter = (
('purpose', admin.ChoicesFieldListFilter),
)
search_fields = ['member__email', 'member__last_name', 'member__first_name']
def full_name(self, obj):
return obj.member.full_name
full_name.admin_order_field = 'member__last_name'

4
bikeshop_project/registration/models.py

@ -109,6 +109,10 @@ class Member(models.Model):
modified_at = models.DateTimeField(auto_now=True)
involvement = MultiSelectField(choices=involvement_choices, null=True, blank=True)
@property
def full_name(self):
return self.get_full_name()
def get_full_name(self):
# The user is identified by their email address
return '{0} {1}'.format(self.first_name, self.last_name)

20
requirements/base.txt

@ -1,16 +1,16 @@
Django==1.10.4
pytz==2015.7
Django==1.11.2
pytz==2017.2 # Updated from 2015.7
django-widget-tweaks==1.4.1
psycopg2==2.6.1
django-libsass==0.6
django_compressor==2.0
python-dateutil==2.5.3
psycopg2==2.7.1 # Updated from 2.6.1
django-libsass==0.7 # Updated from 0.6
django_compressor==2.1.1 # Updated from 2.0
python-dateutil==2.6.0 # Updated from 2.5.3
whoosh==2.7.4
django-haystack==2.5.1
django-haystack==2.6.1 # Updated from 2.5.1
djangorestframework
django-webpack-loader
requests
PyYAML
djangorestframework-jwt==1.9.0
django-multiselectfield==0.1.4
mailchimp3==2.0.11
djangorestframework-jwt==1.11.0 # Updated from 1.9.0
django-multiselectfield==0.1.7 # Updated from 0.1.4
mailchimp3==2.0.14 # Updated from 2.0.11

Loading…
Cancel
Save