Created
June 12, 2016 14:18
-
-
Save FelixINX/9912fe88a0deb9e3e78181f4f28c0c67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SOME DESCRIPTIVE TITLE. | |
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | |
# This file is distributed under the same license as the PACKAGE package. | |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | |
# | |
#, fuzzy | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: PACKAGE VERSION\n" | |
"Report-Msgid-Bugs-To: \n" | |
"POT-Creation-Date: 2016-06-12 10:06-0400\n" | |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | |
"Language-Team: LANGUAGE <LL@li.org>\n" | |
"Language: \n" | |
"MIME-Version: 1.0\n" | |
"Content-Type: text/plain; charset=UTF-8\n" | |
"Content-Transfer-Encoding: 8bit\n" | |
"Plural-Forms: nplurals=2; plural=(n > 1);\n" | |
#: .\MonMagasin\models.py:9 | |
msgid "category_name" | |
msgstr "Nom" | |
#: .\MonMagasin\models.py:10 | |
msgid "category_image" | |
msgstr "Image" | |
#: .\MonMagasin\models.py:11 | |
msgid "category_description" | |
msgstr "Description" | |
#: .\MonMagasin\models.py:17 | |
msgid "category" | |
msgstr "Catégorie" | |
#: .\MonMagasin\models.py:18 | |
msgid "categories" | |
msgstr "Catégories" | |
#: .\MonMagasin\models.py:22 | |
msgid "product_name" | |
msgstr "Nom" | |
#: .\MonMagasin\models.py:23 | |
msgid "product_image" | |
msgstr "Image" | |
#: .\MonMagasin\models.py:24 | |
msgid "product_description" | |
msgstr "Description" | |
#: .\MonMagasin\models.py:25 | |
msgid "product_price" | |
msgstr "Prix" | |
#: .\MonMagasin\models.py:29 | |
msgid "product" | |
msgstr "Produit" | |
#: .\MonMagasin\models.py:30 | |
msgid "products" | |
msgstr "Produits" | |
#: .\MonMagasin\models.py:37 | |
msgid "sale_date_of_sale" | |
msgstr "Date de vente" | |
#: .\MonMagasin\models.py:43 | |
msgid "sale_type_of_sale" | |
msgstr "Type de vente" | |
#: .\MonMagasin\models.py:46 | |
msgid "sale" | |
msgstr "Vente" | |
#: .\MonMagasin\models.py:47 | |
msgid "sales" | |
msgstr "Ventes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from datetime import date | |
from django.utils.translation import ugettext_lazy as _ | |
# Create your models here. | |
class Categorie(models.Model): | |
name = models.CharField(_('category_name'), max_length=55) | |
image = models.CharField(_('category_image'), max_length=255) | |
description = models.TextField(_('category_description'), max_length=500) | |
def __str__(self): | |
return self.name | |
class Meta: | |
verbose_name = _('category') | |
verbose_name_plural = _('categories') | |
class Product(models.Model): | |
name = models.CharField(_('product_name'), max_length=55) | |
image = models.CharField(_('product_image'),max_length=255) | |
description = models.CharField(_('product_description'), max_length=500) | |
price = models.DecimalField(_('product_price'), max_digits=4, decimal_places=2) | |
category = models.ForeignKey(Categorie, on_delete=models.CASCADE) | |
class Meta: | |
verbose_name = _('product') | |
verbose_name_plural = _('products') | |
def __str__(self): | |
return self.name | |
class Sale(models.Model): | |
date_of_sale = models.DateField(_('sale_date_of_sale'),default=date.today) | |
TYPE_OF_SALE_CHOICES = ( | |
('REGULAR', 'Régulier'), | |
('SPECIAL', 'Spécial'), | |
('OTHERS', 'Autres'), | |
) | |
type_of_sale = models.CharField(_('sale_type_of_sale'),choices=TYPE_OF_SALE_CHOICES, default='REGULAR', max_length=7) | |
class Meta: | |
verbose_name = _('sale') | |
verbose_name_plural = _('sales') | |
def __str__(self): | |
return self.dateofsale.strftime(format='%A %w %B %Y') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment