How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
Hi All,

I need your help in one task.
I have created a address form in Django 2.0.6 + Python3.6.
In this form once user entered the address, the location field is auto 
filled with latitude,longitude as below screen shot-



Now I want to write a python function which can fetch Latitude and 
Longitude values from the Location field and can save them in respective 
Latitude/Longitude fields.

My models.py code is as below:
class Store(models.Model):
postal_code = models.CharField(max_length=6)
address = models.TextField()
location = PlainLocationField(based_fields=['address'], zoom=7, 
null=True)
phone = models.CharField(max_length=60, blank=True, null=True)
latitude = models.FloatField()
longitude = models.FloatField()
class Meta:
managed = False
db_table = 'store'

admin.py:

class StoreAdmin(admin.ModelAdmin):
list_display = ('postal_code', 'address','phone', 'latitude', 'longitude')


Can anyone help me to achieve this functionality?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c453ba82-7e0a-4fc1-8c8e-0a588b857627%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Jason
You've been posting here about this regularly (at least four times) with no 
responses.  I don't think anyone here knows how to solve your problem.  
what else have you looked at?  eg, have you asked on stack overflow or 
other places?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/578e878c-967e-45ac-b2b8-ad209424b4ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
Got it Jason, I will not post anymore now.

On Thursday, June 21, 2018 at 5:31:13 PM UTC+5:30, Jason wrote:
>
> You've been posting here about this regularly (at least four times) with 
> no responses.  I don't think anyone here knows how to solve your problem.  
> what else have you looked at?  eg, have you asked on stack overflow or 
> other places?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2c6cc9f6-1455-439c-ad78-459fcc1828ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Julio Biason
Hi Prateek.

You're using Google Maps for the lat/long, right?

In this case, I'd suggest that, on the function you receive the data and
update the field, you also make a request to some URL to update the
lat/long of the current displayed object.

On Thu, Jun 21, 2018 at 9:29 AM, prateek gupta  wrote:

> Got it Jason, I will not post anymore now.
>
> On Thursday, June 21, 2018 at 5:31:13 PM UTC+5:30, Jason wrote:
>>
>> You've been posting here about this regularly (at least four times) with
>> no responses.  I don't think anyone here knows how to solve your problem.
>> what else have you looked at?  eg, have you asked on stack overflow or
>> other places?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/2c6cc9f6-1455-439c-ad78-459fcc1828ab%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Julio Biason*, Sofware Engineer
*AZION*  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101   |  Mobile: +55 51
*99907 0554*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEM7gE3J2Gyj4JdikbUjypanKPk4BVbvjeHXBA7XxSk-t8oAug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Melvyn Sopacua
On donderdag 21 juni 2018 14:29:17 CEST prateek gupta wrote:
> Got it Jason, I will not post anymore now.

Well, not the same question at least. The second one was better, since it was 
specific. What you're asking with this question is too broad and doing it on 
stackoverflow will yield the same results.

You're basically asking us to code it for you, because you have a  deadline 
and not enough understanding of Django or it's eco system. There are a lot of 
helpful people on this list, but if you want this done on the short term, you 
can enlist someone to tutor you or cooperate on the project with you. 
Naturally, you should offer some incentive to people as this isn't a simple 
Question & Answer problem.

-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2859111.WbdiAzZ8Y1%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Jason
Uh, that's not what I mean.  You had asked this question multiple times and 
gotten no response back.  If you're relying on this group for your only 
source of help, that means you lost quite a bit of time getting this done.  
Where else were you looking?  What other options did you try to use?

On Thursday, June 21, 2018 at 8:29:17 AM UTC-4, prateek gupta wrote:
>
> Got it Jason, I will not post anymore now.
>
> On Thursday, June 21, 2018 at 5:31:13 PM UTC+5:30, Jason wrote:
>>
>> You've been posting here about this regularly (at least four times) with 
>> no responses.  I don't think anyone here knows how to solve your problem.  
>> what else have you looked at?  eg, have you asked on stack overflow or 
>> other places?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d97722e7-15e4-4847-be4d-a2236d99ca37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
Thanks for your reply.
I was trying to first use in built django library for that 
https://github.com/caioariede/django-location-field
It is showing me a map with location field(conaining latitude,longitude)
But I want to save the latitude/longitude values in DB so I am not seeing 
any way in this inbuild library.

Now I will try Google API.

On Thursday, June 21, 2018 at 6:04:32 PM UTC+5:30, Julio Biason wrote:
>
> Hi Prateek.
>
> You're using Google Maps for the lat/long, right?
>
> In this case, I'd suggest that, on the function you receive the data and 
> update the field, you also make a request to some URL to update the 
> lat/long of the current displayed object.
>
> On Thu, Jun 21, 2018 at 9:29 AM, prateek gupta  > wrote:
>
>> Got it Jason, I will not post anymore now.
>>
>> On Thursday, June 21, 2018 at 5:31:13 PM UTC+5:30, Jason wrote:
>>>
>>> You've been posting here about this regularly (at least four times) with 
>>> no responses.  I don't think anyone here knows how to solve your problem.  
>>> what else have you looked at?  eg, have you asked on stack overflow or 
>>> other places?
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/2c6cc9f6-1455-439c-ad78-459fcc1828ab%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *Julio Biason*, Sofware Engineer
> *AZION*  |  Deliver. Accelerate. Protect.
> Office: +55 51 3083 8101  |  Mobile: +55 51 *99907 0554*
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b4c346b2-1032-485e-8b96-d1131dcfcc06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Matthew Pava
Based on the information of that project, it does not support Django passed 
version 1.10.  What version are you using?
Saving of the location should be automatic based on my understanding of that 
package.
You may want to contact the author of that package to get more help.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of prateek gupta
Sent: Thursday, June 21, 2018 8:54 AM
To: Django users
Subject: Re: How to fill latitude and longitude values from an existing 
location field in Django+Python?

Thanks for your reply.
I was trying to first use in built django library for that 
https://github.com/caioariede/django-location-field
It is showing me a map with location field(conaining latitude,longitude)
But I want to save the latitude/longitude values in DB so I am not seeing any 
way in this inbuild library.

Now I will try Google API.

On Thursday, June 21, 2018 at 6:04:32 PM UTC+5:30, Julio Biason wrote:
Hi Prateek.

You're using Google Maps for the lat/long, right?

In this case, I'd suggest that, on the function you receive the data and update 
the field, you also make a request to some URL to update the lat/long of the 
current displayed object.

On Thu, Jun 21, 2018 at 9:29 AM, prateek gupta > 
wrote:
Got it Jason, I will not post anymore now.

On Thursday, June 21, 2018 at 5:31:13 PM UTC+5:30, Jason wrote:
You've been posting here about this regularly (at least four times) with no 
responses.  I don't think anyone here knows how to solve your problem.  what 
else have you looked at?  eg, have you asked on stack overflow or other places?
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2c6cc9f6-1455-439c-ad78-459fcc1828ab%40googlegroups.com<https://groups.google.com/d/msgid/django-users/2c6cc9f6-1455-439c-ad78-459fcc1828ab%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.



--
Julio Biason, Sofware Engineer
AZION  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101  |  Mobile: +55 51 99907 0554
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b4c346b2-1032-485e-8b96-d1131dcfcc06%40googlegroups.com<https://groups.google.com/d/msgid/django-users/b4c346b2-1032-485e-8b96-d1131dcfcc06%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/93fc8671d4084469ac8446a08379f977%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Jani Tiainen
Hi,

First I really suggest you to take a look at Django GIS functionality. It
requires few libs to be installed but gives you tons of functionality.
Including fields that can show geometry on map.

Next problem is that you want to convert physical address to coordinates.
Process is called geocoding and there exists several services and libraries
you can use.

Finally the hard part - just combine those two and you get what you're
asking for.


to 21. kesäk. 2018 klo 13.44 prateek gupta  kirjoitti:

> Hi All,
>
> I need your help in one task.
> I have created a address form in Django 2.0.6 + Python3.6.
> In this form once user entered the address, the location field is auto
> filled with latitude,longitude as below screen shot-
>
>
> 
>
> Now I want to write a python function which can fetch Latitude and
> Longitude values from the Location field and can save them in respective
> Latitude/Longitude fields.
>
> My models.py code is as below:
> class Store(models.Model):
> postal_code = models.CharField(max_length=6)
> address = models.TextField()
> location = PlainLocationField(based_fields=['address'], zoom=7,
> null=True)
> phone = models.CharField(max_length=60, blank=True, null=True)
> latitude = models.FloatField()
> longitude = models.FloatField()
> class Meta:
> managed = False
> db_table = 'store'
>
> admin.py:
>
> class StoreAdmin(admin.ModelAdmin):
> list_display = ('postal_code', 'address','phone', 'latitude', 'longitude')
>
>
> Can anyone help me to achieve this functionality?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c453ba82-7e0a-4fc1-8c8e-0a588b857627%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91ocDijwVPxXZ-ynGd%2BFK%3D%2B%3DF4Hbcqaeci-hbYRQQGwhD-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
I am using Django 2.0.6 and yes I am able to use this package .
This package is currently showing a map below the address and once I enter 
the address; it fill the location field and changes the map according.

On Thursday, June 21, 2018 at 7:41:22 PM UTC+5:30, Matthew Pava wrote:
>
> Based on the information of that project, it does not support Django 
> passed version 1.10.  What version are you using?
>
> Saving of the location should be automatic based on my understanding of 
> that package.
>
> You may want to contact the author of that package to get more help.
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *prateek gupta
> *Sent:* Thursday, June 21, 2018 8:54 AM
> *To:* Django users
> *Subject:* Re: How to fill latitude and longitude values from an existing 
> location field in Django+Python?
>
>  
>
> Thanks for your reply.
>
> I was trying to first use in built django library for that 
> https://github.com/caioariede/django-location-field
>
> It is showing me a map with location field(conaining latitude,longitude)
>
> But I want to save the latitude/longitude values in DB so I am not seeing 
> any way in this inbuild library.
>
>  
>
> Now I will try Google API.
>
> On Thursday, June 21, 2018 at 6:04:32 PM UTC+5:30, Julio Biason wrote:
>
> Hi Prateek.
>
>  
>
> You're using Google Maps for the lat/long, right?
>
>  
>
> In this case, I'd suggest that, on the function you receive the data and 
> update the field, you also make a request to some URL to update the 
> lat/long of the current displayed object.
>
>  
>
> On Thu, Jun 21, 2018 at 9:29 AM, prateek gupta  wrote:
>
> Got it Jason, I will not post anymore now.
>
> On Thursday, June 21, 2018 at 5:31:13 PM UTC+5:30, Jason wrote:
>
> You've been posting here about this regularly (at least four times) with 
> no responses.  I don't think anyone here knows how to solve your problem.  
> what else have you looked at?  eg, have you asked on stack overflow or 
> other places?
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/2c6cc9f6-1455-439c-ad78-459fcc1828ab%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/2c6cc9f6-1455-439c-ad78-459fcc1828ab%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> -- 
>
> *Julio Biason*, Sofware Engineer
>
> *AZION*  |  Deliver. Accelerate. Protect.
>
> Office: +55 51 3083 8101  |  Mobile: +55 51 *99907 0554*
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to djang...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/b4c346b2-1032-485e-8b96-d1131dcfcc06%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/b4c346b2-1032-485e-8b96-d1131dcfcc06%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd219fe9-892c-4061-930b-6e8b22849b32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.