Wq

Latest version: v2.1.0

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

Scan your dependencies

Page 4 of 10

1.1.3

**wq.db 1.1.3** brings a bunch of relatively minor bug fixes and enhancements.

Configuration
- Pass Django DEBUG setting to wq.app config (41)
- Properly handle non-root base URL (https://github.com/wq/wq/issues/31, #53)
- Prevent accidentally re-registering the same model twice (d0fa268)
- Use configuration to set page size (085588a)

Router Integration
- Don't require `include()` for `rest.router.urls` (55)
- Include request context in parent serializer for filter-by-parent views (70)
- View might not have router (b20afc4)

Form Generation
- Don't hide `list_exclude` fields in config (62)
- Use 'select one' XLSForm type when rendering Boolean fields (69)

Other
- Various fixes to the [patterns](https://wq.io/docs/about-patterns) module (5129695, f585c78, b5d2689)
- Verify Django 2.1 and Python 3.7 support
- Ensure most test cases work with/without PostgreSQL and with/without GIS support

1.1.2

**wq.db 1.1.1 & 1.1.2** make it possible to use wq.db without requiring GeoDjango (`django.contrib.gis`) and its prerequisites (like GDAL).

1.1.1

**wq.db 1.1.1 & 1.1.2** make it possible to use wq.db without requiring GeoDjango (`django.contrib.gis`) and its prerequisites (like GDAL).

1.1.0

**wq.db 1.1.0** brings support for Django 2.0 and Django REST Framework 3.8, while dropping support for Django <1.11 and DRF 3.6.

This release also removes a bunch of rarely used functionality to improve maintainability:

* [wq.db.patterns.annotate](https://wq.io/docs/annotate)
* [wq.db.patterns.file](https://wq.io/docs/files)
* [wq.db.patterns.locate](https://wq.io/docs/locate)
* [wq.db.patterns.mark](https://wq.io/docs/markdown)
* [wq.db.patterns.relate](https://wq.io/docs/relate)
* [wq.db.contrib.search](https://wq.io/docs/search)
* social auth integration in [wq.db.rest.auth](https://wq.io/docs/auth)

Most of these use cases can be better served with domain-specific models using the newer [design patterns API](https://wq.io/docs/nested-forms). However, some may be recreated as standalone packages if needed.

In addition, Python 2.7 support is no longer tested. It may still work for existing projects using Django 1.11.

This release fixes 71, 72, 73, 74, & 75, and makes 24, 40, & 63 obsolete.

1.0.01

Post-release of [wq.db 1.0](https://github.com/wq/wq.db/releases/v1.0.0-1) to document the temporary lack of support for Django 2.0 (#71 via tomaszn). See 72 for followup.

1.0

Enhancements
- Updates to support Django REST Framework 3 and Django 1.8 (32, 34, 36)
- Improved [patterns](https://wq.io/docs/about-patterns) with support for the [HTML JSON forms](http://www.w3.org/TR/html-json-forms/) field naming convention for submitting "child"/"attachment" records together with a parent object (#33). The "classic" form syntax is still supported but will be dropped in wq.db 1.0. To facilitate rendering lists of attachments in edit views, an array `index` attribute (inspired by Handlebars) has been added to the Mustache template context.
- Added `{{wq_config}}` and `{{page_config}}` to the `wq.db.rest.context_processors`, for better compatibility with [wq/app.js](https://wq.io/docs/app-js) (#25).
- Include a serialization of the referenced `content_object` in serializers for attachment models in `patterns` (7).
- Throw a configuration error if a model is registered with the same name or url as an existing model (21).
- Ensure that patterns models aren't added to content types if they aren't used (14).
- Significantly increased test coverage.
- Various minor bug fixes.

Breaking Changes
1. The model registration API in `wq.db.rest.app` has been moved to `wq.db.rest`. This makes the API even more similar to Django's `admin`, and also eliminates the already overloaded use of "app" as an identifier.
As part of this change, `wq.db.rest.settings` has been moved to `wq.db.default_settings`. For examples, see item 1 in the upgrade notes below.
2. The `patterns` convenience modules (e.g. `wq.db.patterns.models`, `wq.db.patterns.admin`, and the new `wq.db.patterns.serializers`) no longer import everything from the corresponding Django or DRF namespaces. This makes it clearer where various classes are coming from. For examples, see item 2 in upgrade notes below.
3. Dropped compatibility with Django 1.6 (31) and Django REST Framework 2.X. wq.db 0.8.0 and later **will not work** with these versions. All compatibility hacks for Django 1.6 have been removed, as has support for South, now that migrations are built in to Django 1.7 and higher.
4. The default `ModelSerializer` class no longer attempts to automatically create certain one-to-many nested serializers, e.g. the `annotations` attribute on serializers for `AnnotatedModel` subclasses (22). This "magic" behavior proved to be confusing and hard to override. Instead, models extending `AnnotatedModel` or other patterns should be registered with custom serializers, e.g. `AnnotatedModelSerializer`. For an example, see Item 2 in the upgrade notes below. Custom nested serializers can be added using the standard Django REST Framework serializer syntax.
5. Since it's now much easier to create custom patterns and nested serializers, the [annotate](https://wq.io/docs/annotate) pattern is no longer swappable (see #6) and no longer includes a `contenttype` property on `AnnotationType`.
6. Previous versions of the `ModelSerializer` would serialize foreign keys as `[fieldname]_id`, but expect form submissions to use `[fieldname]` (without the `_id` suffix). Needless to say, this inconsistency was confusing to work with. In wq.db 0.8.0, foreign keys are both sent and recieved with the `_id` suffix (11). For an example, see item 4 in the upgrade notes below. As before, the `[fieldname]` without the suffix can be used in detail templates to retrieve properties from the referenced object.
7. The JSONP-based AMD serializer has been removed. This was primarily there to make it possible to load the [wq configuration object](https://wq.io/docs/config) via `config.js`. This file can be generated from the command line via `./manage.py dump_config`.
8. The `{{csrftoken}}` context variable has been removed in favor of Django's built-in `{{csrf_token}}`.

Upgrade Notes

If you are starting with a new project, you shouldn't need to worry about anything in this section. If you have an existing project, you will want to take the following steps:
1. Update all references to `wq.db.rest.app` (e.g. in your `*/rest.py` and your `urls.py`), and references to `wq.db.rest.settings` (e.g. in your `settings.py`).
**`*/rest.py`**

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

app.router.register_model(MyModel)

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

rest.router.register_model(MyModel)


**`urls.py`**

python
Old
from wq.db.rest import app
app.autodiscover()
urlpatterns = patterns('',
url(r'^', include(app.router.urls))
)

New
from wq.db import rest
rest.autodiscover()
urlpatterns = patterns('',
url(r'^', include(rest.router.urls))
)


**`settings.py`**

python
Old
from wq.db.rest.settings import (
TEMPLATE_LOADERS,
TEMPLATE_CONTEXT_PROCESSORS,
...

New
from wq.db.default_settings import (
TEMPLATE_LOADERS,
TEMPLATE_CONTEXT_PROCESSORS,
...

2. If you are using any of the [patterns](https://wq.io/docs/about-patterns) modules, check all of your `models.py` and be sure you explicitly import `django.db.models`.

python
Old
from wq.db.patterns import models

class MyModel(models.IdentifiedModel):
name = models.CharField(max_length=255)

New
from django.db import models
from wq.db.patterns import models as patterns

class MyModel(patterns.IdentifiedModel):
name = models.CharField(max_length=255)


You will also want to update how you register patterns model subclasses with the rest API:

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

app.router.register_model(MyModel)

New
from wq.db import rest
from wq.db.patterns import rest as patterns
from .models import MyModel

rest.router.register_model(
MyModel, serializer=patterns.IdentifiedModelSerializer
)

3. If you are using your own serializer classes, read the [Django REST Framework 3.0](http://www.django-rest-framework.org/topics/3.0-announcement/) release notes and make any necessary changes. In particular, note the new use of `ListSerializer` classes and the renamed `to_representation`/`to_internal_value` methods.
4. Update your "edit" templates to use `[fieldname]_id` when referencing foreign keys.

xml
<!-- Old -->
<input type="hidden" name="type" value="{{type_id}}">
<select name="species">
{{species_list}}
<option value="{{id}}">{{label}}</option>
{{/species_list}}
</select>
<!-- New -->
<input type="hidden" name="type_id" value="{{type_id}}">
<select name="species_id">
{{species_list}}
<option value="{{id}}">{{label}}</option>
{{/species_list}}
</select>


Also, update your `partials/csrf.html` to use the new context variable name

xml
<!-- Old -->
<input type="hidden" name="csrfmiddlewaretoken" value="{{csrftoken}}">
<!-- New -->
<input type="hidden" name="csrfmiddlewaretoken" value="{{csrf_token}}">


If you are using one or more [patterns](https://wq.io/docs/about-patterns), you may also want to take advantage of the new `<input>` naming convention. This will be required as of wq.db 1.0, but both styles are supported for the time being. See the documentation for the individual [patterns](https://wq.io/docs/about-patterns) modules for more information.

Page 4 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.