Changeset 1461
- Timestamp:
- 08/27/08 22:57:11 (3 months ago)
- Files:
-
- satchmo/trunk/satchmo/contact/models.py (modified) (5 diffs)
- satchmo/trunk/satchmo/giftcertificate/models.py (modified) (1 diff)
- satchmo/trunk/satchmo/l10n/models.py (modified) (1 diff)
- satchmo/trunk/satchmo/payment/models.py (modified) (1 diff)
- satchmo/trunk/satchmo/product/comments.py (modified) (2 diffs)
- satchmo/trunk/satchmo/product/models.py (modified) (18 diffs)
- satchmo/trunk/satchmo/shipping/modules/tiered/models.py (modified) (2 diffs)
- satchmo/trunk/satchmo/shipping/modules/tieredquantity/models.py (modified) (2 diffs)
- satchmo/trunk/satchmo/shop/models.py (modified) (9 diffs)
- satchmo/trunk/satchmo/supplier/models.py (modified) (2 diffs)
- satchmo/trunk/satchmo/upsell/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
satchmo/trunk/satchmo/contact/models.py
r1424 r1461 37 37 An organization can be a company, government or any kind of group. 38 38 """ 39 name = models.CharField(_("Name"), max_length=50, core=True)39 name = models.CharField(_("Name"), max_length=50, ) 40 40 type = models.CharField(_("Type"), max_length=30, 41 41 choices=ORGANIZATION_CHOICES) … … 99 99 with. 100 100 """ 101 first_name = models.CharField(_("First name"), max_length=30, core=True)102 last_name = models.CharField(_("Last name"), max_length=30, core=True)101 first_name = models.CharField(_("First name"), max_length=30, ) 102 last_name = models.CharField(_("Last name"), max_length=30, ) 103 103 user = models.ForeignKey(User, blank=True, null=True, unique=True) 104 104 role = models.CharField(_("Role"), max_length=20, blank=True, null=True, … … 178 178 contact = models.ForeignKey(Contact, verbose_name=_("Contact")) 179 179 type = models.CharField(_("Type"), max_length=30,choices=INTERACTION_CHOICES) 180 date_time = models.DateTimeField(_("Date and Time"), core=True)180 date_time = models.DateTimeField(_("Date and Time"), ) 181 181 description = models.TextField(_("Description"), max_length=200) 182 182 … … 196 196 max_length=20, blank=True) 197 197 phone = models.CharField(_("Phone Number"), blank=True, max_length=30, 198 core=True)198 ) 199 199 primary = models.BooleanField(_("Primary"), default=False) 200 200 … … 229 229 description = models.CharField(_("Description"), max_length=20, blank=True, 230 230 help_text=_('Description of address - Home, Office, Warehouse, etc.',)) 231 addressee = models.CharField(_("Addressee"), core=True,max_length=80)232 street1 = models.CharField(_("Street"), core=True,max_length=80)231 addressee = models.CharField(_("Addressee"), max_length=80) 232 street1 = models.CharField(_("Street"), max_length=80) 233 233 street2 = models.CharField(_("Street"), max_length=80, blank=True) 234 234 state = models.CharField(_("State"), max_length=50, blank=True) satchmo/trunk/satchmo/giftcertificate/models.py
r1424 r1461 104 104 notes = models.TextField(_('Notes'), blank=True) 105 105 balance_used = models.DecimalField(_("Amount Used"), decimal_places=2, 106 max_digits=8, core=True)106 max_digits=8, ) 107 107 orderpayment = models.ForeignKey(OrderPayment, null=True, verbose_name=_('Order Payment')) 108 108 used_by = models.ForeignKey(Contact, verbose_name=_('Used by'), satchmo/trunk/satchmo/l10n/models.py
r1424 r1461 74 74 """ 75 75 country = models.ForeignKey(Country) 76 name = models.CharField(_('Admin Area name'), max_length=60, core=True)76 name = models.CharField(_('Admin Area name'), max_length=60, ) 77 77 abbrev = models.CharField(_('Postal Abbreviation'), max_length=3, null=True, blank=True) 78 78 active = models.BooleanField(_('Area is active'), default=True) satchmo/trunk/satchmo/payment/models.py
r1431 r1461 51 51 creditType = CreditChoiceCharField(_("Credit Card Type"), max_length=16) 52 52 displayCC = models.CharField(_("CC Number (Last 4 digits)"), 53 max_length=4, core=True)53 max_length=4, ) 54 54 encryptedCC = models.CharField(_("Encrypted Credit Card"), 55 55 max_length=40, blank=True, null=True, editable=False) satchmo/trunk/satchmo/product/comments.py
r1424 r1461 97 97 98 98 if pks: 99 pks = [pk for pk in pks if _is_int(pk)] 99 100 productdict = Product.objects.in_bulk(pks) 100 101 products = [] … … 116 117 117 118 119 def _is_int(v): 120 try: 121 v = int(v) 122 return True 123 except ValueError: 124 return False satchmo/trunk/satchmo/product/models.py
r1454 r1461 83 83 """ 84 84 site = models.ForeignKey(Site, verbose_name=_('Site')) 85 name = models.CharField(_("Name"), core=True,max_length=200)85 name = models.CharField(_("Name"), max_length=200) 86 86 slug = models.SlugField(_("Slug"), help_text=_("Used for URLs, auto-generated from name if blank"), blank=True) 87 87 parent = models.ForeignKey('self', blank=True, null=True, … … 222 222 category = models.ForeignKey(Category, related_name="translations") 223 223 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES) 224 name = models.CharField(_("Translated Category Name"), max_length=255, core=True)224 name = models.CharField(_("Translated Category Name"), max_length=255, ) 225 225 description = models.TextField(_("Description of category"), default='', blank=True) 226 226 version = models.IntegerField(_('version'), default=1) … … 248 248 caption = models.CharField(_("Optional caption"), max_length=100, 249 249 null=True, blank=True) 250 sort = models.IntegerField(_("Sort Order"), core=True)250 sort = models.IntegerField(_("Sort Order"), ) 251 251 252 252 def translated_caption(self, language_code=None): … … 280 280 categoryimage = models.ForeignKey(CategoryImage, related_name="translations") 281 281 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES) 282 caption = models.CharField(_("Translated Caption"), max_length=255, core=True)282 caption = models.CharField(_("Translated Caption"), max_length=255, ) 283 283 version = models.IntegerField(_('version'), default=1) 284 284 active = models.BooleanField(_('active'), default=True) … … 299 299 """ 300 300 site = models.ForeignKey(Site, verbose_name=_('Site')) 301 name = models.CharField(_("Name of Option Group"), max_length=50, core=True,301 name = models.CharField(_("Name of Option Group"), max_length=50, 302 302 help_text=_("This will be the text displayed on the product page.")) 303 303 description = models.CharField(_("Detailed Description"), max_length=100, … … 330 330 optiongroup = models.ForeignKey(OptionGroup, related_name="translations") 331 331 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES) 332 name = models.CharField(_("Translated OptionGroup Name"), max_length=255, core=True)332 name = models.CharField(_("Translated OptionGroup Name"), max_length=255, ) 333 333 description = models.TextField(_("Description of OptionGroup"), default='', blank=True) 334 334 version = models.IntegerField(_('version'), default=1) … … 358 358 objects = OptionManager() 359 359 option_group = models.ForeignKey(OptionGroup) 360 name = models.CharField(_("Display value"), max_length=50, core=True)360 name = models.CharField(_("Display value"), max_length=50, ) 361 361 value = models.CharField(_("Stored value"), max_length=50) 362 362 price_change = models.DecimalField(_("Price Change"), null=True, blank=True, … … 391 391 option = models.ForeignKey(Option, related_name="translations") 392 392 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES) 393 name = models.CharField(_("Translated Option Name"), max_length=255, core=True)393 name = models.CharField(_("Translated Option Name"), max_length=255, ) 394 394 version = models.IntegerField(_('version'), default=1) 395 395 active = models.BooleanField(_('active'), default=True) … … 436 436 """ 437 437 site = models.ForeignKey(Site, verbose_name=_('Site')) 438 name = models.CharField(_("Full Name"), max_length=255, core=True,blank=False,438 name = models.CharField(_("Full Name"), max_length=255, blank=False, 439 439 help_text=_("This is what the product will be called in the default site language. To add non-default translations, use the Product Translation section below.")) 440 440 slug = models.SlugField(_("Slug Name"), blank=True, … … 741 741 product = models.ForeignKey('Product', related_name="translations") 742 742 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES) 743 name = models.CharField(_("Full Name"), max_length=255, core=True)743 name = models.CharField(_("Full Name"), max_length=255, ) 744 744 short_description = models.TextField(_("Short description of product"), help_text=_("This should be a 1 or 2 line description for use in product listing screens"), max_length=200, default='', blank=True) 745 745 description = models.TextField(_("Description of product"), help_text=_("This field can contain HTML and should be a few paragraphs explaining the background of the product, and anything that would help the potential customer make their purchase."), default='', blank=True) … … 856 856 """ 857 857 858 name = models.CharField(_('Custom field name'), max_length=40, core=True)858 name = models.CharField(_('Custom field name'), max_length=40, ) 859 859 slug = models.SlugField(_("Slug"), help_text=_("Auto-generated from name if blank"), 860 860 blank=True) … … 883 883 customtextfield = models.ForeignKey(CustomTextField, related_name="translations") 884 884 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES) 885 name = models.CharField(_("Translated Custom Text Field Name"), max_length=255, core=True)885 name = models.CharField(_("Translated Custom Text Field Name"), max_length=255, ) 886 886 version = models.IntegerField(_('version'), default=1) 887 887 active = models.BooleanField(_('active'), default=True) … … 1163 1163 """ 1164 1164 subscription = models.ForeignKey(SubscriptionProduct) 1165 price = models.DecimalField(_("Price"), help_text=_("Set to 0 for a free trial. Leave empty if product does not have a trial."), max_digits=10, decimal_places=2, null=True, core=True)1165 price = models.DecimalField(_("Price"), help_text=_("Set to 0 for a free trial. Leave empty if product does not have a trial."), max_digits=10, decimal_places=2, null=True, ) 1166 1166 expire_days = models.IntegerField(_("Trial Duration"), help_text=_("Length of trial billing cycle (days). Leave empty if product does not have a trial."), null=True, blank=True) 1167 1167 … … 1196 1196 """ 1197 1197 product = models.OneToOneField(Product, verbose_name=_('Product'), primary_key=True) 1198 options = models.ManyToManyField(Option, core=True,verbose_name=_('Options'))1199 parent = models.ForeignKey(ConfigurableProduct, core=True,validator_list=[variant_validator], verbose_name=_('Parent'))1198 options = models.ManyToManyField(Option, verbose_name=_('Options')) 1199 parent = models.ForeignKey(ConfigurableProduct, validator_list=[variant_validator], verbose_name=_('Parent')) 1200 1200 1201 1201 objects = ProductVariationManager() … … 1361 1361 product = models.ForeignKey(Product) 1362 1362 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES, null=True, blank=True) 1363 name = models.SlugField(_("Attribute Name"), max_length=100, core=True)1363 name = models.SlugField(_("Attribute Name"), max_length=100, ) 1364 1364 value = models.CharField(_("Value"), max_length=255) 1365 1365 … … 1377 1377 """ 1378 1378 product = models.ForeignKey(Product) 1379 price = models.DecimalField(_("Price"), max_digits=14, decimal_places=6, core=True)1379 price = models.DecimalField(_("Price"), max_digits=14, decimal_places=6, ) 1380 1380 quantity = models.IntegerField(_("Discount Quantity"), default=1, help_text=_("Use this price only for this quantity or higher")) 1381 1381 expires = models.DateField(_("Expires"), null=True, blank=True) … … 1423 1423 caption = models.CharField(_("Optional caption"), max_length=100, 1424 1424 null=True, blank=True) 1425 sort = models.IntegerField(_("Sort Order"), core=True)1425 sort = models.IntegerField(_("Sort Order"), ) 1426 1426 1427 1427 def translated_caption(self, language_code=None): … … 1454 1454 productimage = models.ForeignKey(ProductImage, related_name="translations") 1455 1455 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES) 1456 caption = models.CharField(_("Translated Caption"), max_length=255, core=True)1456 caption = models.CharField(_("Translated Caption"), max_length=255, ) 1457 1457 version = models.IntegerField(_('version'), default=1) 1458 1458 active = models.BooleanField(_('active'), default=True) satchmo/trunk/satchmo/shipping/modules/tiered/models.py
r1460 r1461 204 204 class CarrierTranslation(models.Model): 205 205 carrier = models.ForeignKey('Carrier', related_name='translations') 206 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES, core=True)207 name = models.CharField(_('Carrier'), max_length=50, core=True)206 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES, ) 207 name = models.CharField(_('Carrier'), max_length=50, ) 208 208 description = models.CharField(_('Description'), max_length=200) 209 209 method = models.CharField(_('Method'), help_text=_("i.e. US Mail"), max_length=200) … … 214 214 min_total = models.DecimalField(_("Min Price"), 215 215 help_text=_('The minumum price for this tier to apply'), 216 max_digits=10, decimal_places=2, core=True)217 price = models.DecimalField(_("Shipping Price"), max_digits=10, decimal_places=2, core=True)216 max_digits=10, decimal_places=2, ) 217 price = models.DecimalField(_("Shipping Price"), max_digits=10, decimal_places=2, ) 218 218 expires = models.DateField(_("Expires"), null=True, blank=True) 219 219 satchmo/trunk/satchmo/shipping/modules/tieredquantity/models.py
r1296 r1461 201 201 class CarrierTranslation(models.Model): 202 202 carrier = models.ForeignKey('Carrier', edit_inline=models.STACKED, related_name='translations', num_in_admin=2) 203 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES, core=True)204 name = models.CharField(_('Carrier'), max_length=50, core=True)203 languagecode = models.CharField(_('language'), max_length=10, choices=settings.LANGUAGES, ) 204 name = models.CharField(_('Carrier'), max_length=50, ) 205 205 description = models.CharField(_('Description'), max_length=200) 206 206 method = models.CharField(_('Method'), help_text=_("i.e. US Mail"), max_length=200) … … 211 211 edit_inline=models.TABULAR, related_name='tiers', num_in_admin=5) 212 212 quantity = models.IntegerField(_("Min Quantity"), 213 help_text=_('Minimum qty in order for this to apply?'), core=True)213 help_text=_('Minimum qty in order for this to apply?'), ) 214 214 handling = models.DecimalField(_("Handling Price"), max_digits=10, 215 decimal_places=2, core=True)215 decimal_places=2, ) 216 216 price = models.DecimalField(_("Shipping Per Item"), max_digits=10, 217 decimal_places=2, core=True)217 decimal_places=2, ) 218 218 expires = models.DateField(_("Expires"), null=True, blank=True) 219 219 satchmo/trunk/satchmo/shop/models.py
r1438 r1461 388 388 cart = models.ForeignKey(Cart, verbose_name=_('Cart')) 389 389 product = models.ForeignKey(Product, verbose_name=_('Product')) 390 quantity = models.IntegerField(_("Quantity"), core=True)390 quantity = models.IntegerField(_("Quantity"), ) 391 391 392 392 def _get_line_unitprice(self): … … 460 460 An arbitrary detail about a cart item. 461 461 """ 462 cartitem = models.ForeignKey(CartItem, related_name='details', core=True)462 cartitem = models.ForeignKey(CartItem, related_name='details', ) 463 463 value = models.TextField(_('detail')) 464 464 name = models.CharField(_('name'), max_length=100) … … 569 569 timestamp = models.DateTimeField(_("Timestamp"), blank=True, null=True) 570 570 status = models.CharField(_("Status"), max_length=20, choices=ORDER_STATUS, 571 core=True,blank=True, help_text=_("This is set automatically."))571 blank=True, help_text=_("This is set automatically.")) 572 572 573 573 objects = OrderManager() … … 899 899 order = models.ForeignKey(Order, verbose_name=_("Order")) 900 900 product = models.ForeignKey(Product, verbose_name=_("Product")) 901 quantity = models.IntegerField(_("Quantity"), core=True)901 quantity = models.IntegerField(_("Quantity"), ) 902 902 unit_price = models.DecimalField(_("Unit price"), 903 903 max_digits=18, decimal_places=10) … … 962 962 Name, value pair and price delta associated with a specific item in an order 963 963 """ 964 item = models.ForeignKey(OrderItem, verbose_name=_("Order Item"), core=True)964 item = models.ForeignKey(OrderItem, verbose_name=_("Order Item"), ) 965 965 name = models.CharField(_('Name'), max_length=100) 966 966 value = models.CharField(_('Value'), max_length=255) … … 1033 1033 order = models.ForeignKey(Order, verbose_name=_("Order")) 1034 1034 status = models.CharField(_("Status"), 1035 max_length=20, choices=ORDER_STATUS, core=True,blank=True)1035 max_length=20, choices=ORDER_STATUS, blank=True) 1036 1036 notes = models.CharField(_("Notes"), max_length=100, blank=True) 1037 1037 timestamp = models.DateTimeField(_("Timestamp")) … … 1053 1053 payment = PaymentChoiceCharField(_("Payment Method"), 1054 1054 max_length=25, blank=True) 1055 amount = models.DecimalField(_("amount"), core=True,1055 amount = models.DecimalField(_("amount"), 1056 1056 max_digits=18, decimal_places=10, blank=True, null=True) 1057 1057 timestamp = models.DateTimeField(_("timestamp"), blank=True, null=True) … … 1089 1089 class OrderVariable(models.Model): 1090 1090 order = models.ForeignKey(Order, related_name="variables") 1091 key = models.SlugField(_('key'), core=True)1092 value = models.CharField(_('value'), core=True,max_length=100)1091 key = models.SlugField(_('key'), ) 1092 value = models.CharField(_('value'), max_length=100) 1093 1093 1094 1094 class Meta: … … 1107 1107 """A tax line item""" 1108 1108 order = models.ForeignKey(Order, related_name="taxes") 1109 method = models.CharField(_("Model"), max_length=50, core=True)1109 method = models.CharField(_("Model"), max_length=50, ) 1110 1110 description = models.CharField(_("Description"), max_length=50, blank=True) 1111 tax = models.DecimalField(_("Tax"), core=True,1111 tax = models.DecimalField(_("Tax"), 1112 1112 max_digits=18, decimal_places=10, blank=True, null=True) 1113 1113 satchmo/trunk/satchmo/supplier/models.py
r1424 r1461 61 61 """ 62 62 order = models.ForeignKey(SupplierOrder) 63 line_item = models.ForeignKey(RawItem, core=True,verbose_name=_('Line Item'))64 line_item_quantity = models.IntegerField(_("Line Item Quantity"), core=True)63 line_item = models.ForeignKey(RawItem, verbose_name=_('Line Item')) 64 line_item_quantity = models.IntegerField(_("Line Item Quantity"), ) 65 65 line_item_total = models.DecimalField(_("Line Item Total"), max_digits=6,decimal_places=2) 66 66 … … 80 80 """ 81 81 order = models.ForeignKey(SupplierOrder) 82 status = models.CharField(_("Status"), max_length=20, choices=SUPPLIERORDER_STATUS, core=True,blank=True)82 status = models.CharField(_("Status"), max_length=20, choices=SUPPLIERORDER_STATUS, blank=True) 83 83 notes = models.CharField(_("Notes"), max_length=100, blank=True) 84 84 date = models.DateTimeField(_('Date'), blank=True) satchmo/trunk/satchmo/upsell/models.py
r1424 r1461 129 129 menu = models.ForeignKey(Upsell, related_name="translations") 130 130 languagecode = models.CharField(_('language'), max_length=10, 131 choices=settings.LANGUAGES, core=True,default=settings.LANGUAGES[0][0])131 choices=settings.LANGUAGES, default=settings.LANGUAGES[0][0]) 132 132 description = models.TextField(_('Description'), blank=True) 133 133
