# Path: zipfelchappe/postfinance/models.py
# class Payment(models.Model):
# 
#     order_id = models.CharField(_('order id'), max_length=100)
#     pledge = models.OneToOneField('zipfelchappe.Pledge', 
#         related_name='postfinance_payment')
# 
#     created = models.DateTimeField(auto_now_add=True)
#     updated = models.DateTimeField(auto_now=True)
# 
#     amount = models.CharField(_('amount'), max_length=20, blank=True)
#     currency = models.CharField(_('currency'), max_length=10, blank=True)
# 
#     PAYID = models.CharField(max_length=100, blank=True)
#     STATUS = models.CharField(max_length=100, blank=True)
# 
#     PM = models.CharField(max_length=100, blank=True)
#     ACCEPTANCE = models.CharField(max_length=100, blank=True)
#     CARDNO = models.CharField(max_length=100, blank=True)
#     BRAND = models.CharField(max_length=100, blank=True)
# 
#     class Meta:
#         verbose_name = _('payment')
#         verbose_name_plural = _('payments')
# 
#     def __unicode__(self):
#         return self.order_id
# 
#     def status_text(self):
#         return STATUS_DICT.get(self.STATUS, _('unknown'))
# 
#     def get_amount_cents(self):
#         return int(self.amount)


from django.contrib import admin
from .models import Payment



class PaymentAdmin(admin.ModelAdmin):
    def status_text(self, obj):
        return obj.status_text()

    list_display = ('order_id', 'amount', 'currency', 'status_text', 'updated')
    list_filter = ('pledge__project',)
    readonly_fields = (
        'amount',
        'currency',
        'PAYID',
        'STATUS',
        'status_text',
        'PM',
        'ACCEPTANCE',
        'CARDNO',
        'BRAND',
    )


# Path: zipfelchappe/postfinance/models.py
# class Payment(models.Model):
# 
#     order_id = models.CharField(_('order id'), max_length=100)
#     pledge = models.OneToOneField('zipfelchappe.Pledge', 
#         related_name='postfinance_payment')
# 
#     created = models.DateTimeField(auto_now_add=True)
#     updated = models.DateTimeField(auto_now=True)
# 
#     amount = models.CharField(_('amount'), max_length=20, blank=True)
#     currency = models.CharField(_('currency'), max_length=10, blank=True)
# 
#     PAYID = models.CharField(max_length=100, blank=True)
#     STATUS = models.CharField(max_length=100, blank=True)
# 
#     PM = models.CharField(max_length=100, blank=True)
#     ACCEPTANCE = models.CharField(max_length=100, blank=True)
#     CARDNO = models.CharField(max_length=100, blank=True)
#     BRAND = models.CharField(max_length=100, blank=True)
# 
#     class Meta:
#         verbose_name = _('payment')
#         verbose_name_plural = _('payments')
# 
#     def __unicode__(self):
#         return self.order_id
# 
#     def status_text(self):
#         return STATUS_DICT.get(self.STATUS, _('unknown'))
# 
#     def get_amount_cents(self):
#         return int(self.amount)


# Path: zipfelchappe/postfinance/admin.py
from django.contrib import admin
from .models import Payment




class PaymentAdmin(admin.ModelAdmin):
    def status_text(self, obj):
        return obj.status_text()

    list_display = ('order_id', 'amount', 'currency', 'status_text', 'updated')
    list_filter = ('pledge__project',)
    readonly_fields = (
        'amount',
        'currency',
        'PAYID',
        'STATUS',
        'status_text',
        'PM',
        'ACCEPTANCE',
        'CARDNO',
        'BRAND',
    )


admin.site.register(Payment, PaymentAdmin)