0

I am working on Django serve, my question is How I can print a actual value of this

file modles.bookings.py
    @property
    def grand_total_amount_display(self) -> str:
        return format_currency_amount(self.grand_total_amount, self.currency)
    grand_total_amount_display.fget.short_description = 'Grand Total'


util.spaces file
def get_booking():
    from sook_booking.models.bookings import Booking # circulation-import issue
    print('Booking.grand_total_amount',Booking.grand_total_amount_display)
    return str(Booking.grand_total_amount_display) 

and i am getting this value when I print

Booking.grand_total_amount <property object at 0xffff906b2048>
Yusuf
  • 763
  • 2
  • 8
  • 13
  • 2
    You should use a `Booking` *object*, so `mybooking.grand_total_amount_display` will return the value of the property, with `mybooking` a `Booking` *object*, not the `Booking` class. – Willem Van Onsem May 11 '22 at 12:29

0 Answers0