Opened 14 years ago

Closed 14 years ago

#1150 closed defect (invalid)

The custom method does not work

Reported by: anonymous Owned by: Adrian Holovaty
Component: Core (Other) Version: 0.90
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


from django.core import meta
class Tescik(meta.Model):

... name = meta.CharField(maxlength=255)
... order = meta.IntegerField(null=True)
... def hello(self):
... return "Hello WORLD!"

from django.models.biblia import tesciks
print dir(tesciks)

['AddManipulator', 'ChangeManipulator', 'Klass', 'Tescik', 'TescikDoesNotExist', 'doc', 'file', 'name', '_get_sql_clause', 'get_count', 'get_in_bulk', 'get_iterator', 'get_list', 'get_object', 'get_values', 'get_values_iterator']


Traceback (most recent call last):

File "<interactive input>", line 1, in ?

AttributeError: 'module' object has no attribute 'hello'

Attachments (1) (690 bytes) - added by anonymous 14 years ago.

Download all attachments as: .zip

Change History (2)

Changed 14 years ago by anonymous

Attachment: added

comment:1 Changed 14 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

There's a distinction between "module-level" methods and "class-level" methods. See

Note: See TracTickets for help on using tickets.
Back to Top