Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support of custom table name #48

Merged
merged 2 commits into from
Jul 14, 2016
Merged

Conversation

arwema
Copy link
Contributor

@arwema arwema commented Jun 22, 2016

Added support to specify table name in class definition, overwriting the default pluralized class name

@@ -24,7 +24,8 @@ def __new__(mcs, name, bases, dct):
return super_new(mcs, name, bases, dct)

# Set metadata
dct['_table'] = tableize(name)
if '_table' not in dct:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking, since specifying a table is "public" now, I would have dct['table'] rather than dct['_table']. This would lead to a more readable API as well:

class Artist(Model):
    table = 'artist_tbl'

@arwema
Copy link
Contributor Author

arwema commented Jun 27, 2016

OK I just pushed

@linkyndy linkyndy merged commit d12b5f6 into linkyndy:develop Jul 14, 2016
@linkyndy
Copy link
Owner

linkyndy commented Jul 14, 2016

Sorry for the long wait 👍

Since this PR introduced the need to get rid of a deprecated method, I need to take some time to properly address this issue, as well as some small others and release a major version which is not fully backwards compatible with 0.x.

@arwema arwema deleted the develop branch May 30, 2017 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants