Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
Renamed ORM method 'new' to 'create'
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Apr 2, 2017
1 parent 86b58f1 commit 0a86d2e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Revision History

## 1.4 (unreleased)
## 2.0 (unreleased)

- Removed warnings about calling save/load unnecessarily.
- Allow keyword arguments to be passed to class construction via `new` and `find` utilities.
- Fixed missing attributes added in `__init__` on `AttributeDictionary`.
- **BREAKING**: Disallowed positional arguments to construct dictionary-like converters.
- **BREAKING**: Renamed `ModelMixin.new` to `ModelMixin.create`.

## 1.3 (2017/01/24)

Expand Down
2 changes: 1 addition & 1 deletion yorm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
from .mixins import ModelMixin

__project__ = 'YORM'
__version__ = '1.4dev5'
__version__ = '2.0dev1'
2 changes: 1 addition & 1 deletion yorm/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ModelMixin:
"""Adds ORM methods to a mapped class."""

@classmethod
def new(cls, *args, **kwargs):
def create(cls, *args, **kwargs):
return utilities.create(cls, *args, **kwargs)

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions yorm/tests/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def mixed_instance(mixed_class):
return mixed_class()

@patch('yorm.mixins.utilities')
def it_adds_a_new_method(utilities, mixed_class):
mixed_class.new('foobar', overwrite=True)
def it_adds_a_create_method(utilities, mixed_class):
mixed_class.create('foobar', overwrite=True)

expect(utilities.mock_calls) == [
call.create(mixed_class, 'foobar', overwrite=True)
Expand Down

0 comments on commit 0a86d2e

Please sign in to comment.