SHARE
TWEET

Untitled

a guest Apr 9th, 2019 2 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #models.py
  2.  
  3. from django.db import models
  4. from django.urls import reverse
  5. from django.contrib.auth.models import User
  6.  
  7. # Create your models here.
  8.  
  9. class Casa(models.Model):
  10.  
  11.     nome_casa = models.CharField(max_length=80)
  12.     descrizione = models.TextField()
  13.     logo_casa = models.ImageField(blank=True, null=True)
  14.  
  15.     def __str__(self):
  16.         return self.nome_casa
  17.  
  18.     def get_absolute_url(self):
  19.         return reverse("visualizza_casa", kwargs={"pk" : self.pk})
  20.  
  21.     class Meta:
  22.         verbose_name = "Casa"
  23.         verbose_name_plural = "Case"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top