Skip to content
New issue

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

Support postgres date range fields #81

Closed
berinhard opened this issue Jun 13, 2020 · 0 comments · Fixed by #80
Closed

Support postgres date range fields #81

berinhard opened this issue Jun 13, 2020 · 0 comments · Fixed by #80

Comments

@berinhard
Copy link
Member

Currently model bakery does not support postgres' range fields DateRangeField and DatetimeRangeField.

In #80 I've added support to the numeric range fields, but the date/datetime ones are still missing.

Expected behavior

Model bakery should create random values for models with fields as django.contrib.postgres.fields.DateRangeField or django.contrib.postgres.fields.DatetimeRangeField.

Actual behavior

The following error is being raised:

TypeError: <class 'django.contrib.postgres.fields.ranges.DateRangeField'> is not supported by baker.

Reproduction Steps

How to reproduce this issue.

  1. Add DateRangeField and DatetimeRangeField as new fields in our test model;
  2. The tests will start to fail with the given TypeError exception;

Versions

Python: 3.8
Django: 3.0
Model Bakery: 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant