diff options
author | 2010-05-21 14:59:27 -0500 | |
---|---|---|
committer | 2010-05-21 14:59:27 -0500 | |
commit | fc49abeafa6ddf2277dcd4f6473ebc7ee4bb70ae (patch) | |
tree | a1fdd08a943694a5c80720e13738bb6686e2f8cd | |
parent | fix for syslog stripping messages in [ ] (diff) | |
download | gentoo-ads-fc49abeafa6ddf2277dcd4f6473ebc7ee4bb70ae.tar.gz gentoo-ads-fc49abeafa6ddf2277dcd4f6473ebc7ee4bb70ae.tar.bz2 gentoo-ads-fc49abeafa6ddf2277dcd4f6473ebc7ee4bb70ae.zip |
Removed image-type restriction, and superfluous imports in models & tests
-rw-r--r-- | example_ads.py | 18 | ||||
-rw-r--r-- | gentoo_ads/ads/models.py | 2 | ||||
-rw-r--r-- | gentoo_ads/ads/templates/ads.html | 2 | ||||
-rw-r--r-- | gentoo_ads/ads/tests.py | 24 |
4 files changed, 31 insertions, 15 deletions
diff --git a/example_ads.py b/example_ads.py index 147228d..10c925b 100644 --- a/example_ads.py +++ b/example_ads.py @@ -3,7 +3,12 @@ # tier is not currently used # weight is whatever integer you want, i.e. bogomips, etc -## note: all images must be named with 'name'.png +# note: all images must be referenced with a path relative to MEDIA_URL +# so for example if we want to point at: +# www.example.com/static/imgs/some/path/some/where/my_image.jpg +# and our MEDIA_URL is set to www.example.com/static/ then we would want +# 'name': 'imgs/some/path/some/where/my_image.jpg' +# Note that the MEDIA_URL has a trailing slash !important ads = [ { @@ -12,6 +17,7 @@ ads = [ 'tier': 1, 'weight': 15, #bogomips 'url': 'http://www1.example.com', + 'img': 'path/to/img1.png', 'height': 120, 'width': 125, }, @@ -21,6 +27,7 @@ ads = [ 'tier': 1, 'weight': 25, 'url': 'http://www2.example.com', + 'img': 'path/to/img2.gif', 'height': 120, 'width': 125, }, @@ -30,6 +37,7 @@ ads = [ 'tier': 1, 'weight': 5, 'url': 'http://www3.example.com', + 'img': 'path/to/img3.jpg', 'height': 120, 'width': 125, }, @@ -39,6 +47,7 @@ ads = [ 'tier': 2, 'weight': 105, 'url': 'http://www4.example.com', + 'img': 'path/to/img4.png', 'height': 120, 'width': 125, }, @@ -48,6 +57,7 @@ ads = [ 'tier': 2, 'weight': 19, 'url': 'http://www5.example.com', + 'img': 'path/to/img5.png', 'height': 120, 'width': 125, }, @@ -57,6 +67,7 @@ ads = [ 'tier': 3, 'weight': 150, 'url': 'http://www6.example.com', + 'img': 'path/to/img6.png', 'height': 120, 'width': 125, }, @@ -66,6 +77,7 @@ ads = [ 'tier': 3, 'weight': 170, 'url': 'http://www7.example.com', + 'img': 'path/to/img7.png', 'height': 120, 'width': 125, }, @@ -75,6 +87,7 @@ ads = [ 'tier': 3, 'weight': 11, 'url': 'http://www8.example.com', + 'img': 'path/to/img8.png', 'height': 120, 'width': 125, }, @@ -84,6 +97,7 @@ ads = [ 'tier': 3, 'weight': 1950, 'url': 'http://www9.example.com', + 'img': 'path/to/img9.png', 'height': 120, 'width': 125, }, @@ -93,6 +107,7 @@ ads = [ 'tier': 3, 'weight': 122, 'url': 'http://www10.example.com', + 'img': 'path/to/img10.png', 'height': 120, 'width': 125, }, @@ -102,6 +117,7 @@ ads = [ 'tier': 3, 'weight': 17, 'url': 'http://www11.example.com', + 'img': 'path/to/img11 .png', 'height': 120, 'width': 125, }, diff --git a/gentoo_ads/ads/models.py b/gentoo_ads/ads/models.py index 71a8362..0b4331b 100644 --- a/gentoo_ads/ads/models.py +++ b/gentoo_ads/ads/models.py @@ -1,3 +1,3 @@ -from django.db import models +# from django.db import models # Create your models here. diff --git a/gentoo_ads/ads/templates/ads.html b/gentoo_ads/ads/templates/ads.html index e288870..f4272f8 100644 --- a/gentoo_ads/ads/templates/ads.html +++ b/gentoo_ads/ads/templates/ads.html @@ -12,7 +12,7 @@ <body> <div class="ads"> {% for ad in ads %} - <a href="{{ad.url}}"><img src="{{ MEDIA_URL }}{{ ad.name }}.png" alt="{{ ad.title|slice:":50" }}" title="{{ ad.title|slice:":50" }}" height="{{ ad.height }}" width="{{ ad.width }}" /></a><br /> + <a href="{{ad.url}}"><img src="{{ MEDIA_URL }}{{ ad.img }}" alt="{{ ad.title|slice:":50" }}" title="{{ ad.title|slice:":50" }}" height="{{ ad.height }}" width="{{ ad.width }}" /></a><br /> {% endfor %} </div> </body> diff --git a/gentoo_ads/ads/tests.py b/gentoo_ads/ads/tests.py index 2247054..afa8959 100644 --- a/gentoo_ads/ads/tests.py +++ b/gentoo_ads/ads/tests.py @@ -5,19 +5,19 @@ unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ -from django.test import TestCase +##from django.test import TestCase -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) +#class SimpleTest(TestCase): + #def test_basic_addition(self): + #""" + #Tests that 1 + 1 always equals 2. + #""" + #self.failUnlessEqual(1 + 1, 2) -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. +#__test__ = {"doctest": """ +#Another way to test that 1 + 1 is equal to 2. ->>> 1 + 1 == 2 -True -"""} +#>>> 1 + 1 == 2 +#True +#"""} |