Commits

Zach Woodward committed e2f1a4b Merge with conflicts

Merge branch 'master' of https://bitbucket.org/powersurge360/share_search

Conflicts:
share_search/reviews/templates/reviews/store_detail.html
share_search/reviews/urls.py

Comments (0)

Files changed (5)

share_search/reviews/migrations/0003_auto__add_photomodel.py

+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        # Adding model 'PhotoModel'
+        db.create_table(u'reviews_photomodel', (
+            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100)),
+            ('description', self.gf('django.db.models.fields.TextField')()),
+            ('store', self.gf('django.db.models.fields.related.ForeignKey')(related_name='photos', to=orm['reviews.Store'])),
+        ))
+        db.send_create_signal(u'reviews', ['PhotoModel'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'PhotoModel'
+        db.delete_table(u'reviews_photomodel')
+
+
+    models = {
+        u'reviews.photomodel': {
+            'Meta': {'object_name': 'PhotoModel'},
+            'description': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'photos'", 'to': u"orm['reviews.Store']"})
+        },
+        u'reviews.product': {
+            'Meta': {'object_name': 'Product'},
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'description_html': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        },
+        u'reviews.productreview': {
+            'Meta': {'object_name': 'ProductReview'},
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'body_markup': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reviews'", 'to': u"orm['reviews.Product']"}),
+            'rating': ('django.db.models.fields.IntegerField', [], {}),
+            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'product_reviews'", 'to': u"orm['reviews.Store']"}),
+            'votes': ('django.db.models.fields.IntegerField', [], {})
+        },
+        u'reviews.store': {
+            'Meta': {'object_name': 'Store'},
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'description_html': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        },
+        u'reviews.storereview': {
+            'Meta': {'object_name': 'StoreReview'},
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'body_markup': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'rating': ('django.db.models.fields.IntegerField', [], {}),
+            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reviews'", 'to': u"orm['reviews.Store']"}),
+            'votes': ('django.db.models.fields.IntegerField', [], {})
+        }
+    }
+
+    complete_apps = ['reviews']

share_search/reviews/models.py

         abstract = True
 
 
-class PhotoModel(models.Model):
-    name = models.CharField(max_length=255)
-    image = models.ImageField(upload_to="profile_photos")
-    description = models.TextField()
-    votes = models.IntegerField()
-
-    class Meta:
-        abstract = True
-
-
 class ProfileModel(models.Model):
     name = models.CharField(max_length=255)
     description = models.TextField()
         return ("reviews:store", (self.pk,))
 
 
+class PhotoModel(models.Model):
+    image = models.ImageField(upload_to="profile_photos")
+    description = models.TextField()
+    store = models.ForeignKey(Store, related_name="photos")
+
+
 class Product(ProfileModel):
     image = models.ImageField(upload_to="product_profile")
 

share_search/reviews/templates/reviews/store_detail.html

 {% extends "_layouts/base.html" %}
+{% load gridify %}
 
 {% block title %}{{ block.super }} - {{ object.name }}{% endblock %}
 
         </div>
     </div>
     <div class="row">
+        <h1 class="span12">Photos</h1>
+    </div>
+    <div class="row">
         <div class="span12">
+<<<<<<< HEAD
             <center>List of products available...</center>
+=======
+            {% if object.photos %}
+                <div class="gallery">
+                </div>
+            {% else %}
+                <h3>No photos. {% if user.is_authenticated %}Care to <a href="#">add one?</a>{% else %}<a href="{% url "site:register" %}">Register to add one.</a>{% endif %}</h3>
+            {% endif %}
+>>>>>>> 4899d38d751bc1ec507e29923fa0cb3dd1ef55b7
         </div>
     </div>
 {% endblock %}

share_search/reviews/urls.py

     ),
     url(r'^stores/create/$', StoreCreateView.as_view(), name="store"),
     url(r'^products/$', ProductListView.as_view(template_name="reviews/products.html"), name="product_list"),
+    url(r'^products/$', TemplateView.as_view(template_name="reviews/products.html"), name="product_list"),
     url(r'^stores/create/$', StoreCreateView.as_view(), name="store_create"),
     url(r'^products/create/$', ProductCreateView.as_view(), name="product_create"),
     url(

share_search/share_site/views.py

         if next_url:
             return next_url
 
-        return reverse("site:login")
+        return reverse("home")
 
     def form_valid(self, form):
         user = authenticate(
 
 class LogoutView(RedirectView):
     def get_redirect_url(*args, **kwargs):
-        return reverse("site:login")
+        return reverse("home")
 
     def get(self, *args, **kwargs):
         logout(self.request)
         return super(RegistrationView, self).form_valid(form)
 
     def get_success_url(*args, **kwargs):
-        return reverse("site:login")
+        return reverse("home")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.