Helper for working with the dkjason Python JSON serialization library for Django QuerySets and custom types
This skill helps you work with the dkjason Python library, which provides JSON serialization with special support for Django QuerySets, ttcal objects, and custom serialization methods.
dkjason is a Python library that extends JSON serialization capabilities to handle Django-specific and custom Python types. The intentional misspelling ("jason" vs "json") is a playful naming choice.
**CRITICAL**: Always clear `DJANGO_SETTINGS_MODULE` before running tests to avoid conflicts with test configuration.
```bash
DJANGO_SETTINGS_MODULE= c:/srv/venv/dkjason311/Scripts/pytest -v --cov=dkjason tests
DJANGO_SETTINGS_MODULE= c:/srv/venv/dkjason311/Scripts/pytest tests/test_jason.py -v
DJANGO_SETTINGS_MODULE= c:/srv/venv/dkjason311/Scripts/pytest --cov=dkjason --cov-report=term-missing tests
DJANGO_SETTINGS_MODULE= c:/srv/venv/dkjason311/Scripts/pytest tests/test_jason.py::test_function_name -v
```
For Windows Command Prompt, use `set DJANGO_SETTINGS_MODULE= &&` prefix instead.
```bash
pip install -e .
python setup.py sdist bdist_wheel
inv publish
```
The main module contains:
Objects can implement `__json__()` method for custom serialization. Special types are encoded with `@type:value` format:
1. **Always use the dedicated virtualenv** at `/srv/venv/dkjason311`
2. **Clear DJANGO_SETTINGS_MODULE** before running tests - tests configure Django in `conftest.py`
3. Tests use SQLite database configured in `tests/conftest.py`
4. Main test files: `test_jason.py`, `test_dkjason_import.py`
This project is developed on Windows:
Current version is defined in both `dkjason/__init__.py` and `setup.py`. The package supports multiple Python versions with conditional dependencies in `requirements.txt`.
When asked to work on this codebase:
1. **For bug fixes or features**: Read the relevant module (`dkjason/jason.py` or test files) first
2. **Before running tests**: Verify virtualenv path and clear `DJANGO_SETTINGS_MODULE`
3. **After code changes**: Run tests with coverage to verify changes
4. **For serialization issues**: Check if type needs `__json__()` method or encoder update
5. **For version updates**: Update both `__init__.py` and `setup.py`
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/dkjason-development-assistant/raw