Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read_only_fields in PostgresController #8

Closed
KondratevAD opened this issue Nov 16, 2022 · 10 comments
Closed

Read_only_fields in PostgresController #8

KondratevAD opened this issue Nov 16, 2022 · 10 comments

Comments

@KondratevAD
Copy link

Long story short

Hi, I found that read_only_fields does not work as stated in the documentation

Expected behaviour

In the admin dashboard, field that is specified in read_only_fields should become read-only

Actual behaviour

The field remains changeable

Your environment

  • aiohttp_admin2 version: 0.0.5
  • aiohttp version: 3.8.3
  • Python version: 3.8.10
  • Operating System: Linux
@Arfey
Copy link
Owner

Arfey commented Nov 16, 2022

Hi ✋ could u add example of code and screenshot with result?

@KondratevAD
Copy link
Author

KondratevAD commented Nov 16, 2022

Hi hand could u add example of code and screenshot with result?

if in your example aiohttp_admin2/demo/quick_start/ add read_only_fields to UserController:

class UserController(PostgresController, table=users):
    mapper = UserMapper
    name = 'user'

    inline_fields = ['id', 'full_name', 'is_superuser', 'joined_at']
    search_fields = ['first_name', 'last_name']
    list_filter = ['joined_at', 'is_superuser', ]
    read_only_fields = ['last_name', ]
    ...

in the browser, the field can still be changed:
image

@Arfey
Copy link
Owner

Arfey commented Nov 16, 2022

Sorry, I realized late that you are Russian. Please don't use current open source software.

thx

@KondratevAD
Copy link
Author

KondratevAD commented Nov 16, 2022

Sorry, I realized late that you are Russian. Please don't use current open source software.

thx

Sorry, I`m not understanding you. Why?

@imressed
Copy link

Sorry, I realized late that you are Russian. Please don't use current open source software.
thx

Sorry, I`m not understanding you. Why?

@KondratevAD Hto ne skache, toy moskal.

@bmwant
Copy link

bmwant commented Nov 16, 2022

@KondratevAD russia parasha

@KondratevAD
Copy link
Author

Sorry, I realized late that you are Russian. Please don't use current open source software.
thx

Sorry, I`m not understanding you. Why?

@KondratevAD Hto ne skache, toy moskal.

And why did you decide that all the residents of Russia support all this? I am very sorry for you, you have a very good project. if you don't want to develop it, well, that's up to you. thank you at least for do this

@Arfey
Copy link
Owner

Arfey commented Nov 16, 2022

@KondratevAD i wanna develop this project and i will do but without people from Russia. No mater that all or not all the residents of Russia support WAR. If i will support u i will support your country. No, thanks.

good luck!

@KondratevAD
Copy link
Author

good luck!

Ok, thanks for that too

@KondratevAD
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants