Example #1
0
 def __init__(self,
              model,
              name,
              short_description=None,
              text=len,
              default="",
              template_name=None,
              extra_context=None):
     ChangeListTemplateColumn.__init__(self, short_description,
                                       template_name or self.template_name,
                                       extra_context)
     ChangeListModelFieldColumn.__init__(self, model, name,
                                         short_description, default)
     if self.direct:
         self.to_model = self.field.related.parent_model
         self.to_opts = self.to_model._meta
         self.reverse_name = self.field.rel.related_name
         self.rel_name = self.opts.pk.name
     else:
         self.to_model = self.field.model
         self.to_opts = self.field.opts
         self.reverse_name = self.field.name
         if self.m2m:
             self.rel_name = self.field.rel.get_related_field().name
         else:
             self.rel_name = self.field.rel.field_name
     self.text = text
Example #2
0
 def __init__(self, model, name, short_description=None, default="", template_name=None, extra_context=None):
     ChangeListTemplateColumn.__init__(
         self, short_description, template_name or self.template_name, extra_context, name
     )
     ChangeListModelFieldColumn.__init__(self, model, name, short_description, default)
     self.to_model = self.field.rel.to
     self.to_opts = self.to_model._meta
     self.to_field = self.field.rel.field_name
Example #3
0
 def __init__(self,
              model,
              name,
              short_description=None,
              default="",
              template_name=None,
              extra_context=None):
     ChangeListTemplateColumn.__init__(self, short_description,
                                       template_name or self.template_name,
                                       extra_context, name)
     ChangeListModelFieldColumn.__init__(self, model, name,
                                         short_description, default)
     self.to_model = self.field.rel.to
     self.to_opts = self.to_model._meta
     self.to_field = self.field.rel.field_name
Example #4
0
 def __init__(
     self, model, name, short_description=None, text=len, default="", template_name=None, extra_context=None
 ):
     ChangeListTemplateColumn.__init__(self, short_description, template_name or self.template_name, extra_context)
     ChangeListModelFieldColumn.__init__(self, model, name, short_description, default)
     if self.direct:
         self.to_model = self.field.related.parent_model
         self.to_opts = self.to_model._meta
         self.reverse_name = self.field.rel.related_name
         self.rel_name = self.opts.pk.name
     else:
         self.to_model = self.field.model
         self.to_opts = self.field.opts
         self.reverse_name = self.field.name
         if self.m2m:
             self.rel_name = self.field.rel.get_related_field().name
         else:
             self.rel_name = self.field.rel.field_name
     self.text = text