BaySchoolCS2 / ProjectRepo

Whirpl - A network designed with small communities in mind
MIT License
1 stars 9 forks source link

Api #9

Open fhebert-perkins opened 9 years ago

fhebert-perkins commented 9 years ago

If we do plan on having automatic moderation we should also have an api to call on so that ostensibly we could do more without messing with source.

Perhaps flask-restful?

fhebert-perkins commented 9 years ago

Started the api. Not much to do yet however flask-restful is pretty easy to use

michardy commented 9 years ago
NameError: global name 'collections' is not defined

To fix this you should either import collections or import Posts and get rid of the collections. in front of posts.

from collections import User, Posts

user = User.objects(alias = user)[0]
posts = Posts.objects(author = user)

currently you have:

from collections import User

user = User.objects(alias = user)[0]
posts = collections.Posts.objects(author = User.objects(alias=user)[0])