mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-07 00:15:10 +01:00
Some cleanups
This commit is contained in:
@@ -11,7 +11,6 @@ from utilkit import datetimeutil
|
|||||||
|
|
||||||
from flask import Flask, abort, redirect, render_template, request, url_for
|
from flask import Flask, abort, redirect, render_template, request, url_for
|
||||||
from flask_peewee.db import Database
|
from flask_peewee.db import Database
|
||||||
from flask_peewee.utils import object_list
|
|
||||||
from peewee import *
|
from peewee import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -28,7 +27,6 @@ DATABASE = {
|
|||||||
'name': os.path.join(APP_ROOT, 'bookmarks.db'),
|
'name': os.path.join(APP_ROOT, 'bookmarks.db'),
|
||||||
'engine': 'peewee.SqliteDatabase',
|
'engine': 'peewee.SqliteDatabase',
|
||||||
}
|
}
|
||||||
#PASSWORD = 'shh'
|
|
||||||
#PHANTOM = '/usr/local/bin/phantomjs'
|
#PHANTOM = '/usr/local/bin/phantomjs'
|
||||||
#SCRIPT = os.path.join(APP_ROOT, 'screenshot.js')
|
#SCRIPT = os.path.join(APP_ROOT, 'screenshot.js')
|
||||||
|
|
||||||
@@ -139,9 +137,11 @@ class Bookmark(db.Model):
|
|||||||
def get_tags_for_user(userkey):
|
def get_tags_for_user(userkey):
|
||||||
""" Extract all tags from the bookmarks """
|
""" Extract all tags from the bookmarks """
|
||||||
bookmarks = Bookmark.select(Bookmark.userkey==userkey)
|
bookmarks = Bookmark.select(Bookmark.userkey==userkey)
|
||||||
|
tags = []
|
||||||
for bookmark in bookmarks:
|
for bookmark in bookmarks:
|
||||||
these_tags = bookmark.tags.split(',')
|
these_tags = bookmark.tags.split(',')
|
||||||
print these_tags
|
print these_tags
|
||||||
|
return tags
|
||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
@@ -201,9 +201,6 @@ def addbookmark(userkey):
|
|||||||
#@app.route('/<userkey>/adding')
|
#@app.route('/<userkey>/adding')
|
||||||
def addingbookmark(userkey):
|
def addingbookmark(userkey):
|
||||||
""" Add the bookmark from form submit by /add """
|
""" Add the bookmark from form submit by /add """
|
||||||
#password = request.args.get('password')
|
|
||||||
#if password != PASSWORD:
|
|
||||||
# abort(404)
|
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
title = request.form['title']
|
title = request.form['title']
|
||||||
|
|||||||
Reference in New Issue
Block a user