Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: docs-zip
path: ./docs.zip
path: ./site/docs.zip
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- name: Clean site
run: |
rm -rf ./site
mkdir ./site
- name: Download Artifact Docs
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-docs.yml
run_id: ${{ github.event.workflow_run.id }}
name: docs-zip
path: ./site/
- name: Unzip docs
run: |
rm -rf ./site
cd ./site
unzip docs.zip
rm -f docs.zip
- name: Deploy to Netlify
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Latest Changes

* 👷 Refactor CI artifact upload/download for docs previews. PR [#514](https://github.com/tiangolo/sqlmodel/pull/514) by [@tiangolo](https://github.com/tiangolo).
* ✏️ Fix typo in internal function name `get_sqlachemy_type()`. PR [#496](https://github.com/tiangolo/sqlmodel/pull/496) by [@cmarqu](https://github.com/cmarqu).
* ⬆ Bump actions/cache from 2 to 3. PR [#497](https://github.com/tiangolo/sqlmodel/pull/497) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ✏️ Fix typo in docs. PR [#446](https://github.com/tiangolo/sqlmodel/pull/446) by [@davidbrochart](https://github.com/davidbrochart).
Expand Down
4 changes: 3 additions & 1 deletion scripts/zip-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
set -x
set -e

cd ./site

if [ -f docs.zip ]; then
rm -rf docs.zip
fi
zip -r docs.zip ./site
zip -r docs.zip ./
2 changes: 1 addition & 1 deletion sqlmodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def __init__(
# triggers an error
base_is_table = False
for base in bases:
config = getattr(base, "__config__")
config = getattr(base, "__config__", None)
if config and getattr(config, "table", False):
base_is_table = True
break
Expand Down
23 changes: 23 additions & 0 deletions tests/test_mixin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from typing import Optional

import pytest
from sqlmodel import Field, SQLModel


class FooMixin:
pass


@pytest.mark.usefixtures("clear_sqlmodel")
def test_mixin():
"""Test SQLModel in combination with a mixin.

https://github.com/tiangolo/sqlmodel/issues/254

"""

class Hero(FooMixin, SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
secret_name: str
age: Optional[int] = None