Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ea4de7b
Showing
6 changed files
with
524 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.pyc | ||
.indexes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_id: 2c341d9d-1527-4cd6-8b51-aa7ac7f786dc | ||
pub_date: 2011-02-01 12:30:00 | ||
slug: post2 | ||
title: This is the second post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_id: 80c972cf-f700-4733-814b-dc4fc76230f0 | ||
pub_date: 2011-01-01 17:23:00 | ||
slug: post1 | ||
title: This is the first post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from datetime import datetime | ||
from yamldb import Database, C | ||
|
||
|
||
db = Database('.') | ||
posts = db.declare_collection('posts', ['pub_date', 'slug']) | ||
|
||
def create_posts(): | ||
posts.save({'slug': 'post1', 'title': "This is the first post", | ||
'pub_date': datetime(2011, 1, 1, 17, 23)}) | ||
posts.save({'slug': 'post2', 'title': "This is the second post", | ||
'pub_date': datetime(2011, 2, 1, 12, 30)}) | ||
|
||
def test_queries(): | ||
print posts.query.filter(C.pub_date.year == 2011).all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
|
||
|
||
setup( | ||
name='yamldb', | ||
version='0.1', | ||
url='http://github.com/mitsuhiko/yamldb', | ||
license='BSD', | ||
author='Armin Ronacher', | ||
author_email='armin.ronacher@active-4.com', | ||
description='Wrapper around YAML and SQLite', | ||
py_modules=['yamldb'], | ||
install_requires=['PyYAML>=3.0'], | ||
include_package_data=True, | ||
zip_safe=False, | ||
platforms='any' | ||
) |
Oops, something went wrong.