I have a model with a PointField type of field.

class Article(models.Model):
    id = models.AutoField(primary_key=True)
    title = models.CharField(max_length=300, blank=True)
    point = models.PointField(blank=True)
    status = models.CharField(max_length=27, blank=True)
    objects = models.GeoManager()


When I try to create a new row with any of the following formulations
of pnt, I get an error.
            #pnt = Point((article_lat, article_lng))
            #pnt = fromstr("POINT(%f %f)" % (article_lat,
article_lng))
            pnt = "POINT(%f %f)" % (article_lat, article_lng)
            art = Article(title=article_title, point=pnt,
status=status, channel_name=channel_name)
            art.save()

The error:

"point" is of type point but expression is of type geometry at
character 33
HINT:  You will need to rewrite or cast the expression.

It seems like what I'm trying to do is pretty straightforward, and
similar to the examples at geodjango.org.

What gives?

~Liam

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to