Procházet zdrojové kódy

Updated product list to have a link text field

master
David Winterbottom před 14 roky
rodič
revize
3ad2364938

+ 12
- 0
examples/vanilla/settings_test.py Zobrazit soubor

@@ -0,0 +1,12 @@
1
+from settings import *
2
+
3
+DATABASES = {
4
+    'default': {
5
+        'ENGINE': 'django.db.backends.sqlite3', 
6
+        'NAME': ':memory:',     
7
+        'USER': '',                           
8
+        'PASSWORD': '',                      
9
+        'HOST': '',                     
10
+        'PORT': '',                      
11
+    }
12
+}

+ 4
- 4
oscar/apps/promotions/models.py Zobrazit soubor

@@ -8,12 +8,11 @@ from django.db.models import get_model
8 8
 
9 9
 from oscar.models.fields import ExtendedURLField
10 10
 
11
-from oscar.core.loading import import_module
12
-catalogue_models = import_module('catalogue.models', ['Product',])
13
-
11
+Product = get_model('catalogue', 'Product')
14 12
 Item = get_model('product', 'Item')
15 13
 
16
-# Linking models
14
+
15
+# Linking models - these link promotions to content (eg pages, or keywords)
17 16
 
18 17
 
19 18
 class LinkedPromotion(models.Model):
@@ -183,6 +182,7 @@ class AbstractProductList(AbstractPromotion):
183 182
     name = models.CharField(_("Title"), max_length=255)
184 183
     description = models.TextField(null=True, blank=True)
185 184
     link_url = ExtendedURLField(blank=True, null=True)
185
+    link_text = models.CharField(_("Link text"), max_length=255, blank=True, null=True)
186 186
     date_created = models.DateTimeField(auto_now_add=True)
187 187
     
188 188
     class Meta:

Načítá se…
Zrušit
Uložit