Skip to content

Object has no attribute 'geom' #99

@chseluv

Description

@chseluv

when the views is called I get

AttributeError: 'Apartment' object has no attribute 'geom'

does the model field necessarily storing GeoJSON have to be called "geom"? In my case it's conveniently called "position"

class Apartment(models.Model):
[some indentation] position = PointField()

but I can't serialize these model-objects by doing so in my view:

GeoJSONSerializer().serialize(Apartment.objects.all(), use_natural_keys=True, with_modelname=False)

is there something I ignore or that I'm not understanding?

PS. I'm also looking for information about dealing with the GeoJSON "properties" data, I need to populate it with information from my models. Any documentation about this? I couldn't locate it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions