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

requested_at and remote_addr fields in base_model are not null #6

Open
lingster opened this issue Mar 10, 2020 · 0 comments
Open

requested_at and remote_addr fields in base_model are not null #6

lingster opened this issue Mar 10, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@lingster
Copy link
Owner

copied over from: aschn/drf-tracking#141

In my case, when has IP white lists, the program can't get the remote_addr. But in the base_model, the field is setted to not null.
remote_addr = models.GenericIPAddressField()
the requested_at is the same.
requested_at = models.DateTimeField(db_index=True)
@niubencoolboy
Author
niubencoolboy commented on 24 Jun 2019

So, I changed the two codes to blew:
from django.utils.timezone import now

requested_at = models.DateTimeField(default=now, db_index=True)

remote_addr = models.GenericIPAddressField(null=True, blank=True)

@lingster lingster added the enhancement New feature or request label Mar 10, 2020
dennybiasiolli added a commit to dennybiasiolli/drf-api-tracking that referenced this issue Sep 30, 2021
lingster pushed a commit that referenced this issue May 11, 2023
* models: fixing `requested_at` and `remote_addr` fields

Ref #6

* mixins: fixing flake test with blank line containing whitespace

* tests(models): adding test case for remote_addr=None

* tests(models): adding test case for requested_at=None
CSekwalor referenced this issue in Movemeback/drf-api-tracking Jul 3, 2023
* support for custom user lookup fields added (lingster#61)

* Update base_mixins.py (lingster#70)

* Conditionally define default_app_config (lingster#91)

* Added user agent (Sourcery refactored) (lingster#85)

* Added user agent

* 'Refactored by Sourcery'

---------

Co-authored-by: Dmitry Kalinin <[email protected]>
Co-authored-by: Sourcery AI <>

* Update README.md (lingster#66)

small Python boolean correction

* allow admin chart axes to automatically scale (lingster#65)

* Updates for 1.8.2 release and removed 3.6 from CI testing

* updated django version to resolve some security alerts

* Fixing base model (lingster#72)

* models: fixing `requested_at` and `remote_addr` fields

Ref #6

* mixins: fixing flake test with blank line containing whitespace

* tests(models): adding test case for remote_addr=None

* tests(models): adding test case for requested_at=None

* Improving readme and requirements (lingster#73)

* improving README with makemigrations instructions

* adding missing drf-yasg to requirements

Ref #5

* Added user agent (lingster#84)

* fix python version

* Update version to 1.8.4 (lingster#97)

Added missing migration

Co-authored-by: Ryan P Skadberg <[email protected]>

* use pypi trusted publishing

* added ruff for linter, fixed linter errors

---------

Co-authored-by: Rodrigo Brechard <[email protected]>
Co-authored-by: Minjae Kim <[email protected]>
Co-authored-by: Jeremy Yunis <[email protected]>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Kalinin <[email protected]>
Co-authored-by: Areski Belaid <[email protected]>
Co-authored-by: Rob Spielman <[email protected]>
Co-authored-by: Ling Li <[email protected]>
Co-authored-by: Denny Biasiolli <[email protected]>
Co-authored-by: Ryan Skadberg <[email protected]>
Co-authored-by: Ryan P Skadberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant