ParsePy icon indicating copy to clipboard operation
ParsePy copied to clipboard

Relation and Array support

Open danlipert opened this issue 12 years ago • 5 comments

Is anyone working on relation and array support? I see some references to them in the code but it seems like its a work in progress. I'd be happy to flesh these capabilities out if nobody is working on them.

danlipert avatar Aug 02 '13 02:08 danlipert

Go for it. I think most of the functions are already there on datatypes, so it will probably be a matter of adding them to the map of conversion methods. Let me know if I can help.

lullis avatar Aug 02 '13 08:08 lullis

I think #30 is a start to this, though there may be more functionality you're interested in

dgrtwo avatar Apr 09 '14 17:04 dgrtwo

Hi, there is an error when I try to add a pointer type object like this

    place = Place()
    place.addRelation('category', 'Category_Place', category.objectId)

    place.save()

AttributeError

'NoneType' object has no attribute 'startswith'

Request Method: POST Django Version: 1.6.5 Exception Type: AttributeError Exception Value:

'NoneType' object has no attribute 'startswith'

Exception Location: /Library/Python/2.7/site-packages/parse_rest/connection.py in execute, line 74

folse avatar Aug 10 '14 02:08 folse

@folse You need to save the place object before you add a relation to it, not after. (There might be other issues- it would help if you showed the full traceback in the issue).

dgrtwo avatar Aug 10 '14 22:08 dgrtwo

@dgrtwo Thanks man, it worked.

About the relation datatype, I have another question like above:

place = Place()
place.name = 'abc'
place.save()

place.addRelation('category', 'Category_Place', category.objectId)

after add relation, how can I get the 'category' property which is relation datatype ?

places = Place.Query.all() print places[0].category[0].objectId

When do like this it will get none type.

And @lullis ?

folse avatar Aug 15 '14 07:08 folse