-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from markotibold/rf2
Porting to REST Framework 2, thanks @markotibold
- Loading branch information
Showing
13 changed files
with
340 additions
and
392 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
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,25 @@ | ||
# Changelog | ||
|
||
## dev | ||
|
||
* Enhancement: Ported to REST Framework. **Note:** projects with local REST Framework 0.3.X or 0.3.4 | ||
dependencies will break. | ||
* Enhancements: Updated README file and added this changelog. | ||
|
||
|
||
## 0.9.9.1 | ||
|
||
**Date**: 6th Dec 2012 | ||
|
||
* Security-Bugfix: Changed permission check in API from IsAuthenticated to IsAdminUser | ||
|
||
|
||
## 0.9.9 | ||
|
||
**Date**: 27th Nov 2012 | ||
|
||
* Enhancement: Title fields of pages are now required. Solves inconsistent behaviour in the UI. | ||
|
||
--- | ||
|
||
Older changes not documented. Revert to the git log for details. |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include LICENSE.rst | ||
include README.rst | ||
include README.md | ||
recursive-include fiber/templates * | ||
recursive-include fiber/static * |
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
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
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,25 @@ | ||
from rest_framework import serializers | ||
|
||
from fiber.app_settings import PERMISSION_CLASS | ||
from fiber.utils import class_loader | ||
from fiber.utils.date import friendly_datetime | ||
|
||
PERMISSIONS = class_loader.load_class(PERMISSION_CLASS) | ||
|
||
|
||
class CanEditField(serializers.Field): | ||
""" | ||
A custom field that returns True if request.user has | ||
permission to edit obj. | ||
""" | ||
|
||
def field_to_native(self, obj, field_name): | ||
return PERMISSIONS.can_edit(self.context['request'].user, obj) | ||
|
||
|
||
class UpdatedField(serializers.Field): | ||
""" | ||
Return a friendly timestamp. | ||
""" | ||
def field_to_native(self, obj, field_name): | ||
return friendly_datetime(obj.updated) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.