Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Technical aspects, customization, code samples.
Post Reply
rosario.dandrea
Posts: 8
Joined: Fri Jan 31, 2020 9:39 am

Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Post by rosario.dandrea »

Hi,
I'm currently trying to write a new app and I'm having the following issue:
When specifying a new field using DecimalField in models, and displaying it with SingleObjectDetailView in views, the field appears as editable - I have tried with the "Editable=False" option in models, but then Django crashes complaining when I try adding or show details for a item. I don't have any issues with CharField or TextField.
I suppose there's something that needs to be done in views to set the DecimalField as read-only, but I can't seem to be finding anything which works.
Thanks for your time.

User avatar
rosarior
Developer
Developer
Posts: 513
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Post by rosarior »

Hi,

Can you post a screenshot?

I added a temporary decimal number field and it shows as a read only form field.
2020-01-31_22-03.png
2020-01-31_22-03.png (71.58 KiB) Viewed 286 times

User avatar
rosarior
Developer
Developer
Posts: 513
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Post by rosarior »

I think I see what you meant. It should look like a plain value like the other fields.

Mayan EDMS doesn't use Decimal fields and the look in the template for decimal fields falls back to a standard read only field. If that is the case that can be added easy and we can push it to the bugfix version being worked on right now.
2020-01-31_22-05.png
2020-01-31_22-05.png (68.19 KiB) Viewed 284 times

rosario.dandrea
Posts: 8
Joined: Fri Jan 31, 2020 9:39 am

Re: Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Post by rosario.dandrea »

Ok, thanks you for your support.

User avatar
rosarior
Developer
Developer
Posts: 513
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Post by rosarior »

The update to support this was added in version 3.3.10. Sadly it also broke document previews.

Instead of removing it, we just fixed document previews and re-implemented the read only decimal field support.

This will be available in version 3.3.11 which should be ready in the next hours.

https://gitlab.com/mayan-edms/mayan-edm ... 289aac5a8e

rosario.dandrea
Posts: 8
Joined: Fri Jan 31, 2020 9:39 am

Re: Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Post by rosario.dandrea »

Thank you for your help - much appreciated.

Post Reply