Closed clstaudt closed 1 year ago
@clstaudt YES instances where IDs are created manually should be deleted (by replacing fake data with real backend implementation). Ids should not be displayed on the front end either (I did remove most of that but the few that may remain are also to be removed)
BUT NO to That would also mean that methods like get_entity_by_id or get_all_entities_as_mapping (from id -> entity) should not exist, right?
. The screen that displays a list of items, when said item is clicked needs to pass it's id to the details screen. That is why methods like these two are needed. Also the IDs can serve as keys for the items when displayed in a list view (or grid view ) in the mappings otherwise the view will have to come up with another way to identify a specific object which would be redundant.
@vlad-ed-git I see, but for example ContactsIntent.get_contact_by_id
is never called. Why does the method exist?
Currently it seems that the app code handles model object ids explicitly:
SQLModel objects are assigned an id when they are stored in the database. It's the row index for the database table.
I would claim that the app does not have to know the ids and they should be hidden from the app. Ids are entirely handled by the sqlmodel backend.
That would also mean that methods like
get_entity_by_id
orget_all_entities_as_mapping
(from id -> entity) should not exist, right?@vlad-ed-git Please comment.