Просмотр исходного кода

Update release details and add licence info

master
Costas Basdekis 12 лет назад
Родитель
Сommit
fe06a5ec97
2 измененных файлов: 20 добавлений и 0 удалений
  1. 5
    0
      docs/source/releases/v0.6.rst
  2. 15
    0
      oscar/models/fields.py

+ 5
- 0
docs/source/releases/v0.6.rst Просмотреть файл

@@ -347,6 +347,11 @@ There are new migrations in the following apps to be aware of.
347 347
     - ``0003``: ``Country``'s ``is_highlighted`` is now an integer to allow
348 348
       finer control.
349 349
 
350
+* ShippingAddress:
351
+
352
+    - ``0018``: ``ShippingAddress``'s ``phone_number`` is now a PhoneNumberField
353
+      to allow fine validation.
354
+
350 355
 * Order app:
351 356
 
352 357
     - The `date` field of the ``order.AbstractCommunicationEvent``, ``order.AbstractPaymentEvent`` and

+ 15
- 0
oscar/models/fields.py Просмотреть файл

@@ -69,6 +69,21 @@ class UppercaseCharField(CharField):
69 69
             return val
70 70
 
71 71
 class PhoneNumberField(Field):
72
+    """
73
+    Copyright (c) 2011 Stefan Foulis and contributors.
74
+    https://github.com/stefanfoulis/django-phonenumber-field
75
+    
76
+    Taken from fork https://github.com/maikhoepfel/django-phonenumber-field/
77
+    
78
+    A international phone number field for django that uses
79
+    http://pypi.python.org/pypi/phonenumbers for validation.
80
+    
81
+    * Validates a wide range of phone number formats
82
+    * Displays it nicely formatted
83
+    * Can be given a hint for the country, so that it can accept local numbers,
84
+      that are not in an international format
85
+    """
86
+    
72 87
     attr_class = phonenumber.PhoneNumber
73 88
     descriptor_class = phonenumber.PhoneNumberDescriptor
74 89
     default_validators = [phonenumber.validate_international_phonenumber]

Загрузка…
Отмена
Сохранить