Ho un modello che memorizza una posizione utenti:Django Rest Framework - Come limitare i risultati restituiti con la geolocalizzazione?
[
{
"url": "http://192.168.0.22:8000/status/1/",
"id": 1,
"owner": 1,
"test_info": "",
"created_at": "2015-05-02T07:09:16.535689Z",
"updated_at": "2015-05-02T07:09:16.535746Z",
"geolocation": null,
"jukebox_mode_enabled": false
},
{
"url": "http://192.168.0.22:8000/status/2/",
"id": 2,
"owner": 2,
"test_info": "",
"created_at": "2015-05-02T07:09:24.206959Z",
"updated_at": "2015-05-02T07:09:24.207042Z",
"geolocation": null,
"jukebox_mode_enabled": false
},
io sto cercando di realizzare un sistema che permette agli utenti di interrogare e vedere chi altro si trova nelle vicinanze, ma per motivi di sicurezza vorrei per limitare i risultati agli utenti con dire 1KM.
Qual è il modo migliore per raggiungere questo obiettivo?
P.S - Lo "stato" è legato al modello utente normale nel modello django utilizzando oneToOneField.
Perfetto! - Grazie – jwv