habe ein Problem mit PyLint und Pydev-Eclipse.
Ich schreibe ein Django-Project und habe dort Klassen erstellt, die von models.Model abgeleitet wurden.
Nun beschwert sich PyLint aber bei jeder dieser Klassen, das es z.B. das member "objects" nicht gibt, obwohl das nicht stimmt.
Hier mal die Klassendefinition:ID:E1101 _sendmail: Class 'MailNotification' has no 'objects' member
Code: Alles auswählen
from django.db import models
class MailNotification(models.Model):
name = models.CharField(maxlength=100,
help_text="shortname of the MailNotification. This name " \
"is used as an unique ID for database searches.")
mail_to = models.EmailField(
help_text="recipient mail address")
mail_from = models.EmailField(blank=True,
help_text="optional: sender mail address")
timeout = models.IntegerField(blank=True, null=True,
help_text="optional: timeout in minutes")
subject = models.CharField(maxlength=200,
help_text="subject for mail.")
message = models.TextField(
help_text="the mail message.<br/>" \
"If you define the mail for " \
"<b>logged in users</b>, please note that there are 2 " \
"variables which can be replaced with custom data:<br/>" \
"<br/>" \
"<b><USER></b>: will be replaced with " \
"current user name<br/> " \
"<b><USER_ID></b>: will be replaced with " \
"the database ID " \
"of the current user")
class Admin:
list_display = ('name', 'subject', 'message')
ordering = ['name']
def __str__(self):
return self.name
Code: Alles auswählen
mail = MailNotification.objects.get(name='logged_in_users')