Answer the question
In order to leave comments, you need to log in
What to do if you need properties in Russian from the database?
Hello everyone. I want to make sure I understand correctly.
I'm trying to make an online store. I have a page of product categories, such as laptops, phones, etc.
There is a page of product cards that correspond to the selected category. And there is a page of the product itself, its full description. Let's take a laptop. The database stores properties in the form key=value. For example: name = Asus Notebook, type=ultrabook, etc. But I need to display the keys in Russian on the product page. Type Name: Asus Notebook, type: ultrabook, matrix type: IPS, etc.
Do I understand correctly that I need to create a table of all properties of the type name=name, type=type, drive_value=media capacity, etc. And then do join tables? Or am I not thinking right? Thanks
Answer the question
In order to leave comments, you need to log in
Human names are usually already done on the client, by type
<label>Тип:{{entity.type}}</label>
In the database they rarely store something that does not change. The names of your keys are unlikely to change, and the data will change constantly.
If such a setting occurs, then yes, you need to create a special table where readable names for all fields will be stored, and then join. But all this will greatly complicate the base, and the scheme, as well. most of the data will be of the type of dictionaries, because for each entity, you separately need to store all its fields.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question