Wq

Latest version: v2.1.0

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 10

1.0.0

**wq.db 1.0.0** is finally here! This is the first stable release of wq.db 1.0, which is now ready for production use.

Changes since wq.db 1.0.0 RC1
* Standardize and fix the results of various `type_filter` settings with [EAV serializers](https://wq.io/docs/eav-vs-relational). Thanks to davidoj for help with this update (#64, 65, 66, 67)
* Fix typo in `ModelViewSet` (68 via tomaszn)
* Various improvements to [identify pattern](https://wq.io/docs/identify) (2863130)
* Support for `HEAD` on more views (d51c504)
* Don't override declared label fields (42)
* Incorporate [Code of Conduct](https://github.com/wq/wq.db/blob/master/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/wq/wq.db/blob/master/CONTRIBUTING.md)

1.0.0rc2

wq.app RC2 brings a number of minor bug fixes and improvements to [RC1](https://github.com/wq/wq.app/releases/tag/v1.0.0rc1).

* Generate scss folder for swatch tests (87 by tomaszn)
* Update vendored Leaflet & leaflet plugins
* Added `wq-status` option to `<progress>` plugin (7eca458, see [docs](https://wq.io/docs/progress-js))
* Handle case when outbox syncs during a list view data fetch (45162e0)
* Various other fixes (see [commit log](https://github.com/wq/wq.app/compare/v1.0.0rc1...v1.0.0rc2))

1.0.0rc1

**wq.db 1.0.0 RC1** brings a number of enhancements to improve integration with wq.start and wq.app.

1.0.0b3

**wq.db 1.0 beta 3** brings a couple of new features as well as minor bug fixes.

API Change

Django REST Framework 3.5 enforces the [requirement](http://www.django-rest-framework.org/topics/3.5-announcement/#modelserializer-fields-and-exclude) that all ModelSerializers have an explicit `fields` or `exclude` attribute. This is supported in wq.db with a new "fields" argument to `router.register_model`. As in DRF, you can request the old behavior of including all fields by specifying `"__all__"` as the argument:

python
from wq.db import rest
from .models import MyModel

rest.router.register_model(
MyModel,
fields="__all__",
)


New Configuration Options
- To facilitate the generation of labels for items still in the outbox, it is now possible to define a label template for a model (using the Mustache syntax) . This is defined as an attribute (`wq_label_template`) on the _model_ class (rather than the serializer) so that it can be available for use by the `__str__` method. The new `LabelModel` in [wq.db.patterns.models](https://github.com/wq/wq.db/blob/master/patterns/base/models.py) provides an implementation of the `__str__` method. Whether or not you extend `LabelModel`, you can set `wq_label_template` on any model to have the setting propagated to the [wq configuration](https://wq.io/docs/config) object and then used in the outbox (for [wq.app 1.0.0b2 or newer](https://github.com/wq/wq.app/releases/v1.0.0b2))
- Serializers can now have a `wq_field_config` Meta attribute to customize the form configuration for specific fields. This is primarily to facilitate support for the `filter` configuration option when generating form fields for foreign keys. On the client (wq.app), the filter option is parsed and then passed on to `model.filter()`. On the server (wq.db), the updated `get_lookup_choices()` will take the same setting into account when rendering edit views.

By way of example, here is a model that uses both `wq_label_template` and `wq_field_config`:

python
myapp/models.py
from django.db import models
from wq.db.patterns.models import LabelModel

class Item(LabelModel):
name = models.Model()
type = models.ForeignKey("ItemType")

wq_label_template = "{{name}}"

class ItemType(models.Model):
active = models.BooleanField()
...

myapp/serializers.py
class ItemSerializer(ModelSerializer):
class Meta:
Add the following attributes to the automatically-generated field config for "type"
wq_field_config = {
'type': {
'filter': {
'active': [
Always allow active types
'1',

Allow inactive types when editing existing items
'{{id}}0{{/id}}{{^id}}1{{/id}}',
]
}
}
}

myapp/rest.py
from wq.db import rest
from .models import Item, ItemType
from .serializers import ItemSerializer

rest.router.register_model(
Item,
serializer=ItemSerializer,
fields="__all__",
)
rest.router.register_model(
ItemType,
fields="__all__",
)


The resulting configuration object will look something like this:

javascript
// config.json
{
"pages": {
"item": {
"url": "items",
"list": true,
"label_template": "{{name}}", // copied from model
"form": [{
// ... other fields ...
}, {
"name": "type",
"label": "Type",
"type": "string",
"wq:ForeignKey": "itemtype",
"filter": {"active": ["1", "{{id}}0{{/id}}{{^id}}1{{/id}}"]}, // copied from serializer
"bind": {"required": True}
}]
},
// ... other pages ...
}
}


Other Improvements
- Django compatibility improvements
- Enable `APP_DIRS` support for [django-mustache](https://github.com/wq/django-mustache)
- Support nested [Django Natural Keys](https://github.com/wq/django-natural-keys) in the form configuration object (including natural keys containing one or more foreign keys).
- Don't crash on `HEAD` and `OPTIONS` HTTP verbs
- Fixes for `dump_config`, `wq.db.patterns.identify`, and GeoJSON support

1.0.0b2

Minor update to the [**wq.db 1.0 beta**](https://github.com/wq/wq.db/releases/v1.0.0b1) to ensure [wq.core](https://wq.io/wq.core) knows **wq.db** is installed (a66a929; see wq/wq.core#1).

1.0.0b1

**wq.db 1.0 beta** brings minor bug fixes and code style improvements to [wq.db 1.0 alpha](https://github.com/wq/wq.db/releases/tag/v1.0.0a1).

Page 5 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.