Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
from django.contrib.auth.models import User from django.db import models class Place(models.Model): RATING_CHOICES = [ (1, '1 Star'), (2, '2 Stars'), (3, '3 Stars'), (4, '4 Stars'), (5, '5 Stars'), ] CATEGORY_CHOICES = [ ('Mountain', 'Mountain'), ('Sea', 'Sea'), ('Historical Site', 'Historical Site'), ('City', 'City'), ('Spa', 'Spa'), ('Wine Tourism', 'Wine Tourism') ] name = models.CharField( max_length=200, null=False, blank=False, ) description = models.TextField( null=False, blank=False, ) location = models.CharField( max_length=200, null=False, blank=False, ) rating = models.IntegerField( choices=RATING_CHOICES, null=True, blank=True, ) image = models.ImageField( upload_to='photos/', null=True, blank=True, ) category = models.CharField(max_length=100, choices=CATEGORY_CHOICES, null=True, blank=True) def __str__(self): return self.name
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)