Django/Mezzanine: Unable to display model's data into Template -


After many attempts and errors, I am unable to get the model display in the template, I have tried the template tag or view I have probably used to remember a few steps ...

I have created a page through the name Mezanin name "Customer Data" (URL as Customer-Data), and after that A template name has been created "customer-data.html"

models.py

class c Customer Data (Model. Model): number = model.carfield (max_lamp = 50, help_text = "contact") First_name = models.CharField (max_length = 50, help_text = "first name") last_name = models.CharField (max_length = 50) , Help_text = "last name") Email = Model.carfield (max_length = 200, help_text = "email") Address = Model TextField (max_length = 200, help_text = "address") owner = model. Forward (user_model_name, verbose_name = "author") class meta: verbose_name = _ ("customer") verbose_name _pll == ("customer") def __unicode __ (self): return "% s% s (% S)"% (Self.first_name, self.last_name, self.number)

views.py

  (customer-data_list ': Customer_data_list})  

Submit submission (request, 'customer-data.html', {customer_data_list}: customer_data_list} Cust_tags.py

  @ register.as_tag def customer_data (* args): data = client data.object.All () return list (data)  

cus Tomer-data.html

  {% link main%} {{page.description}} 

in template {{custdata.first_name}} Using any great example would be very helpful, thank you in advance.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -