Open timmartin opened 6 years ago
The same:
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
class AbstractPage(models.Model):
updated_at = models.DateTimeField(
default=timezone.now,
verbose_name=_('Date updated'),
)
published_at = models.DateTimeField(
default=timezone.now,
verbose_name=_('First publication date'),
)
class Meta:
abstract = True
class Post(AbstractPage):
@property
def is_updated(self):
published_at = self.published_at.replace(microsecond=0) # line: 101
updated_at = self.updated_at.replace(microsecond=0)
return updated_at > published_at
$ .venv/bin/pylint \
--load-plugins=pylint_django \
--django-settings-module=branch.settings.test \
./branch ./apps
************* Module apps.blog.models
apps/blog/models.py:101:23: E1123: Unexpected keyword argument 'microsecond' in method call (unexpected-keyword-arg)
Bumping, as after 3 years this is still an issue.
I've encountered it with the following package versions:
Django==3.2.9
pylint==2.11.1
pylint-django==2.4.4
pylint-plugin-utils==0.6
With the following code:
I get warnings:
I believe these are incorrect. If I remove the inheritance and instantiate
models.FileField
rather thanExtraFileField
on the model, the warnings go away even though this ought to make no difference.I notice there are some cases that have special handling for
models.FileField
, maybe this just needs to be extended to classes that inherit from it?pip freeze output: