Exemplo n.º 1
0
def reset_db():
    try:
        posts = Post.objects()
        sites = Site.objects()
        users = User.objects()
        images = Image.objects()
        deps = Dependency.objects()
        flatpages = FlatPage.objects()

        posts.delete()
        sites.delete()
        users.delete()
        deps.delete()
        flatpages.delete()
        return "all images, posts, sites, and users deleted successfully!"
    except:
        print "There was an error..."
Exemplo n.º 2
0
def manage():
    flats = FlatPage.objects()
    posts = Post.objects()
    images = Image.objects()
    return dict(posts=posts, images=images, flats=flats)