# Path: floreal/francais.py
# class Plural(models.Model):
#     def __str__(self):
# def plural(noun, n=None):
# def articulate(noun, n=1):
# 
# Path: floreal/models.py
# class IdentifiedBySlug(models.Model):
#     class Meta:
# class Mapped(models.Model):
#     class Meta:
# class FlorealUser(IdentifiedBySlug, Mapped):
# class NetworkSubgroup(IdentifiedBySlug):
#     class Meta:
# class NetworkMembership(models.Model):
#     class Meta:
# class Network(IdentifiedBySlug, Mapped):
#     class Meta:
# class Delivery(IdentifiedBySlug):
#     class Meta:
# class Product(models.Model):
#     class Meta:
# class Purchase(models.Model):
#     class Meta:
# class Bestof(models.Model):
#     class Meta:
# class JournalEntry(models.Model):
# class AdminMessage(models.Model):
#     def slug_prefix(self):
#     def save(self, **kwargs):
#     def __str__(self):
#     def slug_prefix(self):
#     def display_name(self):
#     def display_number(self):
#     def uri(self):
#     def has_some_admin_rights(self):
#     def __str__(self) -> str:
#     def __str__(self):
#     def __str__(self):
#     def description_text(self):
#     def grouped(self):
#     def save(self, **kwargs):
#     def __str__(self):
#     def state_name(self):
#     def description_text(self):
#     def freeze_overdue_deliveries(cls):
#     def __str__(self):
#     def _normalize_unit(cls, u):
#     def save(
#         self, force_insert=False, force_update=False, using=None, update_fields=None
#     ):
#     def left(self):
#     def description_text(self):
#     def price(self):
#     def weight(self):
#     def packages(self):
#     def out_of_package(self):
#     def max_quantity(self):
#     def __str__(self, specify_user=False):
#     def __str__(self):
#     def update(cls):
#     def log(cls, u, fmt, *args, **kwargs):
#     def __str__(self):
#     def __str__(self):
#     (PREPARATION, ORDERING_ALL, ORDERING_ADMIN, FROZEN, TERMINATED) = "ABCDE"
#     STATE_CHOICES = {
#         PREPARATION: "En préparation",
#         ORDERING_ALL: "Ouverte",
#         ORDERING_ADMIN: "Admins",
#         FROZEN: "Gelée",
#         TERMINATED: "Terminée",
#     }
#     UNIT_AUTO_TRANSLATE = {
#         "1": "pièce",
#         "piece": "pièce",
#         "kilo": "kg",
#         "gr": "g",
#         "unité": "pièce",
#         "unite": "pièce",
#     }
#     UNIT_TRANSLATE_REGEXP = re.compile(r"""
#         ^
#         ([0-9]+) 
#         (?:  [,.]  ([0-9]+)  )?
#         \s*
#         ([A-Za-z]+)
#         $""", re.VERBOSE)


from datetime import datetime, date
from django import template
from django.utils.dateparse import parse_date
from floreal import francais
from floreal import models as m
@register.filter
def forced_sign(f):
    return "%+g" % f

@register.filter
def price(f):
    return "%.02f€" % f

@register.filter
def price_nocurrency(f):
    return "%.02f" % f

@register.filter
def weight(w):
    if w>=1: return "%.2gkg" % w
    else: return "%dg" % (w*1000)

@register.filter
def email(u):
    return '"%s %s" <%s>' % (u.first_name, u.last_name, u.email)

@register.filter
def unit_multiple(unit, n=None):
    if unit[0].isdigit():
        return "×"+unit
    else:
        return " "+m.plural(unit, n)

@register.filter
def articulate(name, n=None):

# Path: floreal/francais.py
# class Plural(models.Model):
#     def __str__(self):
# def plural(noun, n=None):
# def articulate(noun, n=1):
# 
# Path: floreal/models.py
# class IdentifiedBySlug(models.Model):
#     class Meta:
# class Mapped(models.Model):
#     class Meta:
# class FlorealUser(IdentifiedBySlug, Mapped):
# class NetworkSubgroup(IdentifiedBySlug):
#     class Meta:
# class NetworkMembership(models.Model):
#     class Meta:
# class Network(IdentifiedBySlug, Mapped):
#     class Meta:
# class Delivery(IdentifiedBySlug):
#     class Meta:
# class Product(models.Model):
#     class Meta:
# class Purchase(models.Model):
#     class Meta:
# class Bestof(models.Model):
#     class Meta:
# class JournalEntry(models.Model):
# class AdminMessage(models.Model):
#     def slug_prefix(self):
#     def save(self, **kwargs):
#     def __str__(self):
#     def slug_prefix(self):
#     def display_name(self):
#     def display_number(self):
#     def uri(self):
#     def has_some_admin_rights(self):
#     def __str__(self) -> str:
#     def __str__(self):
#     def __str__(self):
#     def description_text(self):
#     def grouped(self):
#     def save(self, **kwargs):
#     def __str__(self):
#     def state_name(self):
#     def description_text(self):
#     def freeze_overdue_deliveries(cls):
#     def __str__(self):
#     def _normalize_unit(cls, u):
#     def save(
#         self, force_insert=False, force_update=False, using=None, update_fields=None
#     ):
#     def left(self):
#     def description_text(self):
#     def price(self):
#     def weight(self):
#     def packages(self):
#     def out_of_package(self):
#     def max_quantity(self):
#     def __str__(self, specify_user=False):
#     def __str__(self):
#     def update(cls):
#     def log(cls, u, fmt, *args, **kwargs):
#     def __str__(self):
#     def __str__(self):
#     (PREPARATION, ORDERING_ALL, ORDERING_ADMIN, FROZEN, TERMINATED) = "ABCDE"
#     STATE_CHOICES = {
#         PREPARATION: "En préparation",
#         ORDERING_ALL: "Ouverte",
#         ORDERING_ADMIN: "Admins",
#         FROZEN: "Gelée",
#         TERMINATED: "Terminée",
#     }
#     UNIT_AUTO_TRANSLATE = {
#         "1": "pièce",
#         "piece": "pièce",
#         "kilo": "kg",
#         "gr": "g",
#         "unité": "pièce",
#         "unite": "pièce",
#     }
#     UNIT_TRANSLATE_REGEXP = re.compile(r"""
#         ^
#         ([0-9]+) 
#         (?:  [,.]  ([0-9]+)  )?
#         \s*
#         ([A-Za-z]+)
#         $""", re.VERBOSE)


# Path: floreal/templatetags/floreal_filters.py
from datetime import datetime, date
from django import template
from django.utils.dateparse import parse_date
from floreal import francais
from floreal import models as m

@register.filter
def forced_sign(f):
    return "%+g" % f

@register.filter
def price(f):
    return "%.02f€" % f

@register.filter
def price_nocurrency(f):
    return "%.02f" % f

@register.filter
def weight(w):
    if w>=1: return "%.2gkg" % w
    else: return "%dg" % (w*1000)

@register.filter
def email(u):
    return '"%s %s" <%s>' % (u.first_name, u.last_name, u.email)

@register.filter
def unit_multiple(unit, n=None):
    if unit[0].isdigit():
        return "×"+unit
    else:
        return " "+m.plural(unit, n)

@register.filter
def articulate(name, n=None):

    return m.articulate(name, n)