Esempio n. 1
0
# Alias the Object type to make clear is not a normal python Object
from parse_rest.datatypes import Object as ParseObject

printSubTitle("First register the app")

register(APPLICATION_ID, REST_API_KEY)


printSubTitle("Parse is a NOSQL database.")
# https://en.wikipedia.org/wiki/NoSQL
printExplain("So, you not need to pre-create the data schema, and can drop/add data & columns at will")

anyObject = ParseObject()

printExplain("Simple set a value to the object. No need to exist before..")
anyObject.title = 'Hello world'
anyObject.score = 100


def saveToParse(anyObject):
    print "Saving..."

    anyObject.save()

    print "Done!"

saveToParse(anyObject)

printExplain("Parse automatically add the nexts read-only fields on save:")

printSubTitle("objectId")