On Thu, Jun 16, 2011 at 11:07 AM, Micky Hulse <[email protected]> wrote:
> Just hoping some of the pro Django/Python users on this list could
> school me on this one. :D
Actually, here's an example that I am working on now.
In my model, I have a CharField that holds the latitude/longitude with
values that look like:
44.08577787869324,-123.052459359169
I would like to write model methods to return latitude and longitude.
[code]
def lat(self):
# ...
def lng(self):
# ...
[code]
Should I use a property decorator?
Also, what is the difference between this:
[code]
def _get_lat(self):
# ...
lat = property(_get_lat)
[/code]
... and this:
[code]
@property
def lat(self):
# ...
[/code]
Sorry if stupid questions.
Thanks!
Micky
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.