On 24 août 13:04, David Allison wrote: > Hello, Hi,
> We're using pylint and Django in Pydev on Eclipse. > > Recently, some of our team upgraded from Pylint 0.18 to 0.21, and one of the > features that doesn't seem to work anymore is passing > '--generated-members=objects' to prevent pylint from complaining about the > auto-generated 'objects' instance variable on Django Model classes. > > Now, I've done a bunch of googling, and it looks the feature should still be > present, and indeed: > > # pylint --long-help > [...] > --generated-members=<members names> > List of members which are set dynamically and missed > by pylint inference system, and so shouldn't trigger > E0201 when accessed. [current: > REQUEST,acl_users,aq_parent] > [...] > > But for whatever reason, statements like: > > reports = MyModel.objects.filter(is_authoritative=True) > > > Yields an error like this one: > > E1101: 36:my_method: Class 'MyModel' has no 'objects' member > > I noticed in the documentation that --generated-members is supposed to > prevent E0201 errors, rather than the E1101 error I'm seeing. > > Does anyone know how to prevent this type of error? In pylint 0.18 (and I > believe 0.19), --generated-members=objects did the trick for our Django > models. > > What is the recommended practice now? Wait for a 0.21.2 release :( Or apply the following patch on pylint: http://www.logilab.org/cgi-bin/hgwebdir.cgi/pylint/rev/7654451d76b8 > I also found this ticket: > > http://www.logilab.org/ticket/28796 > > but wasn't sure if it was strictly the same issue (though it sure seems to > be). it is very likely -- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org _______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
