S
S
SashaN692020-12-07 15:54:21
MySQL
SashaN69, 2020-12-07 15:54:21

Database is correct?

I am writing a telegram bot and ran into a problem. I have a simple auto-sales bot with the /addcity command with which you can add a city that will be given to the user for selection. And you need to somehow add the ability to add districts to a specific city. MySQL database. it has a city table where the id and the name of the city are. I do all queries using python and the pymySQL library.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2020-12-07
@SashaN69

The method is simpler: make a city_district table, for example, with city_id, name fields, and write districts in it.
A cooler method: use some KLADR, FIAS, Yandex API, Google, open street maps or something else, and stop adding districts manually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question