def note_single(city, slug): """ Arguments: - `city`: """ single_note = db.notes.find_one({"slug_url": "/not/" + city + "/" + slug}) return serialize_mongodb_object(single_note)
def notes_for_city(city): """ Arguments: - `city`: """ if city not in ["ankara", "istanbul", "izmir"]: return abort(404) notes = db.notes.find({"slug_city": city}) notes = notes.sort("insert_date", pymongo.DESCENDING) return serialize_mongodb_object(notes)