Permalink
Browse files

Renaming package to be more pythonic

  • Loading branch information...
1 parent 5ea82f8 commit 5543728115c8743a9e7d17b6089d36e438d5a45a @coleifer committed Nov 24, 2011
Showing with 84 additions and 84 deletions.
  1. +1 −1 MANIFEST.in
  2. +4 −4 docs/admin.rst
  3. +8 −8 docs/api.rst
  4. +3 −3 docs/auth.rst
  5. +1 −1 docs/database.rst
  6. +8 −8 docs/getting-started.rst
  7. +7 −7 docs/rest-api.rst
  8. +1 −1 docs/utils.rst
  9. +1 −1 example/admin.py
  10. +1 −1 example/api.py
  11. +1 −1 example/app.py
  12. +1 −1 example/auth.py
  13. +1 −1 example/models.py
  14. +1 −1 example/views.py
  15. 0 {flaskext → flask_peewee}/__init__.py
  16. +3 −3 {flaskext → flask_peewee}/admin.py
  17. +2 −2 {flaskext → flask_peewee}/auth.py
  18. +2 −2 {flaskext → flask_peewee}/db.py
  19. 0 {flaskext → flask_peewee}/exceptions.py
  20. 0 {flaskext → flask_peewee}/filters.py
  21. +2 −2 {flaskext → flask_peewee}/rest.py
  22. 0 {flaskext → flask_peewee}/serializer.py
  23. 0 {flaskext → flask_peewee}/static/css/admin.css
  24. 0 {flaskext → flask_peewee}/static/css/bootstrap.min.css
  25. 0 {flaskext → flask_peewee}/static/js/admin.js
  26. 0 {flaskext → flask_peewee}/static/js/bootstrap-alerts.js
  27. 0 {flaskext → flask_peewee}/static/js/bootstrap-dropdown.js
  28. 0 {flaskext → flask_peewee}/static/js/bootstrap-tabs.js
  29. 0 {flaskext → flask_peewee}/static/js/events.js
  30. 0 {flaskext → flask_peewee}/static/js/jquery.min.js
  31. 0 {flaskext → flask_peewee}/static/js/modernizr-1.5.min.js
  32. 0 {flaskext → flask_peewee}/templates/admin/base.html
  33. 0 {flaskext → flask_peewee}/templates/admin/includes/filter_dropdown.html
  34. 0 {flaskext → flask_peewee}/templates/admin/includes/filter_widgets.html
  35. 0 {flaskext → flask_peewee}/templates/admin/includes/pagination.html
  36. 0 {flaskext → flask_peewee}/templates/admin/index.html
  37. 0 {flaskext → flask_peewee}/templates/admin/models/add.html
  38. 0 {flaskext → flask_peewee}/templates/admin/models/base.html
  39. 0 {flaskext → flask_peewee}/templates/admin/models/base_filters.html
  40. 0 {flaskext → flask_peewee}/templates/admin/models/delete.html
  41. 0 {flaskext → flask_peewee}/templates/admin/models/edit.html
  42. 0 {flaskext → flask_peewee}/templates/admin/models/export.html
  43. 0 {flaskext → flask_peewee}/templates/admin/models/index.html
  44. 0 {flaskext → flask_peewee}/templates/admin/panels/base.html
  45. 0 {flaskext → flask_peewee}/templates/admin/panels/default.html
  46. 0 {flaskext → flask_peewee}/templates/auth/login.html
  47. 0 {flaskext → flask_peewee}/templates/macros/filters.html
  48. 0 {flaskext → flask_peewee}/templates/macros/forms.html
  49. +5 −0 flask_peewee/tests/__init__.py
  50. +4 −4 {flaskext → flask_peewee}/tests/admin.py
  51. +3 −3 {flaskext → flask_peewee}/tests/auth.py
  52. +2 −2 {flaskext → flask_peewee}/tests/base.py
  53. +4 −4 {flaskext → flask_peewee}/tests/rest.py
  54. +7 −7 {flaskext → flask_peewee}/tests/serializer.py
  55. 0 {flaskext → flask_peewee}/tests/templates/admin/notes.html
  56. 0 {flaskext → flask_peewee}/tests/templates/base.html
  57. +6 −6 {flaskext → flask_peewee}/tests/test_app.py
  58. 0 {flaskext → flask_peewee}/tests/test_config.py
  59. +3 −3 {flaskext → flask_peewee}/tests/utils.py
  60. 0 {flaskext → flask_peewee}/utils.py
  61. BIN flaskext/static/img/icon-no.gif
  62. BIN flaskext/static/img/icon-yes.gif
  63. BIN flaskext/static/img/icon_addlink.gif
  64. BIN flaskext/static/img/icon_changelink.gif
  65. BIN flaskext/static/img/icon_deletelink.gif
  66. +0 −5 flaskext/tests/__init__.py
  67. +1 −1 runtests.py
  68. +1 −1 setup.py
View
@@ -2,5 +2,5 @@ include LICENSE
include README.rst
recursive-include docs *
recursive-include example *
-recursive-include flaskext *
+recursive-include flask_peewee *
prune docs/_build
View
@@ -23,8 +23,8 @@ To get started with the admin, there are just a couple steps:
from flask import Flask
- from flaskext.auth import Auth
- from flaskext.db import Database
+ from flask_peewee.auth import Auth
+ from flask_peewee.db import Database
app = Flask(__name__)
db = Database(app)
@@ -38,7 +38,7 @@ To get started with the admin, there are just a couple steps:
.. code-block:: python
# continued from above...
- from flaskext.admin import Admin
+ from flask_peewee.admin import Admin
admin = Admin(app, auth)
@@ -100,7 +100,7 @@ admin, we'll subclass :py:class:`ModelAdmin`.
.. code-block:: python
- from flaskext.admin import ModelAdmin
+ from flask_peewee.admin import ModelAdmin
class MessageAdmin(ModelAdmin):
columns = ('user', 'content', 'pub_date',)
View
@@ -24,9 +24,9 @@ Admin
from flask import Flask
- from flaskext.admin import Admin
- from flaskext.auth import Auth
- from flaskext.db import Database
+ from flask_peewee.admin import Admin
+ from flask_peewee.auth import Auth
+ from flask_peewee.db import Database
app = Flask(__name__)
db = Database(app)
@@ -391,8 +391,8 @@ Auth
from flask import Flask
- from flaskext.auth import Auth
- from flaskext.db import Database
+ from flask_peewee.auth import Auth
+ from flask_peewee.db import Database
app = Flask(__name__)
db = Database(app)
@@ -608,7 +608,7 @@ REST API
.. code-block:: python
- from flaskext.rest import RestAPI
+ from flask_peewee.rest import RestAPI
from app import app # our project's Flask app
@@ -858,7 +858,7 @@ Authenticating requests to the API
from auth import auth # import the Auth object used by our project
- from flaskext.rest import RestAPI, RestResource, UserAuthentication
+ from flask_peewee.rest import RestAPI, RestResource, UserAuthentication
# create an instance of UserAuthentication
user_auth = UserAuthentication(auth)
@@ -908,7 +908,7 @@ Authenticating requests to the API
from auth import auth # import the Auth object used by our project
- from flaskext.rest import RestAPI, RestResource, UserAuthentication, AdminAuthentication
+ from flask_peewee.rest import RestAPI, RestResource, UserAuthentication, AdminAuthentication
# create an instance of UserAuthentication and AdminAuthentication
user_auth = UserAuthentication(auth)
View
@@ -31,8 +31,8 @@ an :py:class:`Auth` backend for your project:
from flask import Flask
- from flaskext.auth import Auth
- from flaskext.db import Database
+ from flask_peewee.auth import Auth
+ from flask_peewee.db import Database
app = Flask(__name__)
db = Database(app)
@@ -110,7 +110,7 @@ Here's a simple example of extending the auth system to use a custom user model:
.. code-block:: python
- from flaskext.auth import BaseModel # <-- implements set_password and check_password
+ from flask_peewee.auth import BaseModel # <-- implements set_password and check_password
app = Flask(__name__)
db = Database(app)
View
@@ -30,7 +30,7 @@ be passed to the database driver when connecting:
from flask import Flask
from peewee import *
- from flaskext.db import Database
+ from flask_peewee.db import Database
DATABASE = {
'name': 'example.db',
View
@@ -59,7 +59,7 @@ initialize the peewee database wrapper and configure the database:
from flask import Flask
# flask-peewee bindings
- from flaskext.db import Database
+ from flask_peewee.db import Database
# configure our database
DATABASE = {
@@ -131,7 +131,7 @@ among other things, and is required by the :py:class:`Admin`.
.. code-block:: python
- from flaskext.auth import Auth
+ from flask_peewee.auth import Auth
# create an Auth object for use with our flask app and database wrapper
auth = Auth(app, db)
@@ -153,8 +153,8 @@ After cleaning up the imports and declarations, we have something like the follo
import datetime
from flask import Flask
- from flaskext.auth import Auth
- from flaskext.db import Database
+ from flask_peewee.auth import Auth
+ from flask_peewee.db import Database
from peewee import *
# configure our database
@@ -196,7 +196,7 @@ the initialization of the ``Auth`` class:
.. code-block:: python
- from flaskext.admin import Admin
+ from flask_peewee.admin import Admin
admin = Admin(app, auth)
admin.register(Note)
@@ -234,7 +234,7 @@ the following changes:
.. code-block:: python
- from flaskext.admin import Admin, ModelAdmin
+ from flask_peewee.admin import Admin, ModelAdmin
class NoteAdmin(ModelAdmin):
columns = ('message', 'created',)
@@ -270,7 +270,7 @@ The first step, then, is to create the :py:class:`RestAPI` object:
.. code-block:: python
- from flaskext.rest import RestAPI
+ from flask_peewee.rest import RestAPI
# create a RestAPI container
api = RestAPI(app)
@@ -353,7 +353,7 @@ auth credentials match those of one of the ``auth.User`` models.
.. code-block:: python
- from flaskext.rest import RestAPI, UserAuthentication
+ from flask_peewee.rest import RestAPI, UserAuthentication
# instantiate the user auth
user_auth = UserAuthentication(auth)
View
@@ -40,7 +40,7 @@ we will expose via the API. Here is a truncated version of what they look like:
.. code-block:: python
- from flaskext.auth import BaseUser
+ from flask_peewee.auth import BaseUser
class User(db.Model, BaseUser):
username = CharField()
@@ -70,7 +70,7 @@ Here we'll create a simple api and register our models:
.. code-block:: python
- from flaskext.rest import RestAPI
+ from flask_peewee.rest import RestAPI
from app import app # our project's Flask app
@@ -169,7 +169,7 @@ from serialization, subclass :py:class:`RestResource`:
.. code-block:: python
- from flaskext.rest import RestAPI, RestResource
+ from flask_peewee.rest import RestAPI, RestResource
from app import app # our project's Flask app
@@ -220,7 +220,7 @@ mechanism.
from auth import auth # import the Auth object used by our project
- from flaskext.rest import RestAPI, RestResource, UserAuthentication
+ from flask_peewee.rest import RestAPI, RestResource, UserAuthentication
# create an instance of UserAuthentication
user_auth = UserAuthentication(auth)
@@ -307,7 +307,7 @@ content.
.. code-block:: python
- from flaskext.rest import RestrictOwnerResource
+ from flask_peewee.rest import RestrictOwnerResource
class MessageResource(RestrictOwnerResource):
@@ -333,7 +333,7 @@ It is fine to modify our own message, though (message with id=1):
# prints 200
-Under-the-hood, the `implementation <https://github.com/coleifer/flask-peewee/blob/master/flaskext/rest.py#L284>`_ of the :py:class:`RestrictOwnerResource` is pretty simple.
+Under-the-hood, the `implementation <https://github.com/coleifer/flask-peewee/blob/master/flask_peewee/rest.py#L284>`_ of the :py:class:`RestrictOwnerResource` is pretty simple.
* PUT / DELETE -- verify the authenticated user is the owner of the object
* POST -- assign the authenticated user as the owner of the new object
@@ -348,7 +348,7 @@ to administrators:
.. code-block:: python
- from flaskext.rest import AdminAuthentication
+ from flask_peewee.rest import AdminAuthentication
# instantiate our user-based auth
user_auth = UserAuthentication(auth)
View
@@ -65,7 +65,7 @@ Misc
.. code-block:: python
- from flaskext.utils import slugify
+ from flask_peewee.utils import slugify
class Blog(db.Model):
View
@@ -1,7 +1,7 @@
import datetime
from flask import request, redirect
-from flaskext.admin import Admin, ModelAdmin, AdminPanel
+from flask_peewee.admin import Admin, ModelAdmin, AdminPanel
from app import app, db
from auth import auth
View
@@ -1,4 +1,4 @@
-from flaskext.rest import RestAPI, RestResource, UserAuthentication, AdminAuthentication, RestrictOwnerResource
+from flask_peewee.rest import RestAPI, RestResource, UserAuthentication, AdminAuthentication, RestrictOwnerResource
from app import app
from auth import auth
View
@@ -1,7 +1,7 @@
from flask import Flask
# flask-peewee bindings
-from flaskext.db import Database
+from flask_peewee.db import Database
app = Flask(__name__)
View
@@ -1,4 +1,4 @@
-from flaskext.auth import Auth
+from flask_peewee.auth import Auth
from app import app, db
from models import User
View
@@ -1,7 +1,7 @@
from hashlib import md5, sha1
import datetime
-from flaskext.auth import BaseUser
+from flask_peewee.auth import BaseUser
from peewee import *
from app import db
View
@@ -2,7 +2,7 @@
from flask import request, redirect, url_for, render_template, flash
-from flaskext.utils import get_object_or_404, object_list
+from flask_peewee.utils import get_object_or_404, object_list
from app import app
from auth import auth
File renamed without changes.
@@ -8,9 +8,9 @@
import json
from flask import Blueprint, render_template, abort, request, url_for, redirect, flash, Response
-from flaskext.filters import BooleanSelectField, QueryFilter
-from flaskext.serializer import Serializer
-from flaskext.utils import get_next, PaginatedQuery, slugify
+from flask_peewee.filters import BooleanSelectField, QueryFilter
+from flask_peewee.serializer import Serializer
+from flask_peewee.utils import get_next, PaginatedQuery, slugify
from peewee import BooleanField, ForeignKeyField, TextField, Q
from werkzeug import Headers
from wtforms import fields, widgets
@@ -5,7 +5,7 @@
from peewee import *
from wtforms import Form, TextField, PasswordField, validators
-from flaskext.utils import get_next, make_password, check_password
+from flask_peewee.utils import get_next, make_password, check_password
current_dir = os.path.dirname(__file__)
@@ -57,7 +57,7 @@ def __unicode__(self):
def get_model_admin(self, model_admin=None):
if model_admin is None:
- from flaskext.admin import ModelAdmin
+ from flask_peewee.admin import ModelAdmin
model_admin = ModelAdmin
class UserAdmin(model_admin):
@@ -1,8 +1,8 @@
import peewee
from peewee import *
-from flaskext.exceptions import ImproperlyConfigured
-from flaskext.utils import load_class
+from flask_peewee.exceptions import ImproperlyConfigured
+from flask_peewee.utils import load_class
class Database(object):
File renamed without changes.
File renamed without changes.
@@ -7,8 +7,8 @@
from flask import Blueprint, abort, request, Response, session, redirect, url_for, g
from peewee import *
-from flaskext.serializer import Serializer, Deserializer
-from flaskext.utils import PaginatedQuery, slugify, get_object_or_404
+from flask_peewee.serializer import Serializer, Deserializer
+from flask_peewee.utils import PaginatedQuery, slugify, get_object_or_404
class Authentication(object):
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,5 @@
+from flask_peewee.tests.admin import *
+from flask_peewee.tests.auth import *
+from flask_peewee.tests.rest import *
+from flask_peewee.tests.serializer import *
+from flask_peewee.tests.utils import *
@@ -2,10 +2,10 @@
from flask import request, session, url_for
-from flaskext.admin import ModelAdmin, AdminPanel
-from flaskext.tests.base import FlaskPeeweeTestCase
-from flaskext.tests.test_app import User, Message, Note, admin
-from flaskext.utils import get_next, make_password, check_password
+from flask_peewee.admin import ModelAdmin, AdminPanel
+from flask_peewee.tests.base import FlaskPeeweeTestCase
+from flask_peewee.tests.test_app import User, Message, Note, admin
+from flask_peewee.utils import get_next, make_password, check_password
from wtfpeewee.orm import model_form
@@ -2,9 +2,9 @@
from flask import request, session, url_for, get_flashed_messages
-from flaskext.auth import Auth, LoginForm
-from flaskext.tests.base import FlaskPeeweeTestCase
-from flaskext.tests.test_app import User, app, db, auth
+from flask_peewee.auth import Auth, LoginForm
+from flask_peewee.tests.base import FlaskPeeweeTestCase
+from flask_peewee.tests.test_app import User, app, db, auth
class TestAuth(Auth):
@@ -1,7 +1,7 @@
import unittest
-from flaskext.tests import test_app
-from flaskext.tests.test_app import User, Message, Note
+from flask_peewee.tests import test_app
+from flask_peewee.tests.test_app import User, Message, Note
class FlaskPeeweeTestCase(unittest.TestCase):
Oops, something went wrong.

0 comments on commit 5543728

Please sign in to comment.