We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm use Peewee ORM.
I have a class such as this:
class Sample(PMBaseModel): id = peewee.PrimaryKeyField() location = peewee.CharField(max_length=255) position = peewee.IntegerField() class Meta: db_table = 'sample'
how i can use Meta Class for set default ordering and define Order type?
The text was updated successfully, but these errors were encountered:
Well, I think setting a default ordering is always a bad idea, but since you asked:
class Meta: order_by = ('location', '-position')
order_by is a tuple. The elements of the tuple are field names. If prefixed by a "-", then the field is ordered descending.
order_by
Sorry, something went wrong.
6969201 contains doc updates.
No branches or pull requests
I'm use Peewee ORM.
I have a class such as this:
how i can use Meta Class for set default ordering and define Order type?
The text was updated successfully, but these errors were encountered: