Integration with LFS

61 views
Skip to first unread message

jarik

unread,
Nov 30, 2010, 9:36:37 AM11/30/10
to django-lfc
Hi all!

Is there a simple way to integrate existing LFC-based site with LFS? I
need a shopping cart. On some pages I need to show my products (a page
per product type) and want to give a user an ability to buy them. From
admin-side I want LFS management UI to manage my products, customers,
prices, etc.

Maybe I should use something like django-cart...

If someone has such an experience , please help me!

jarik

unread,
Nov 30, 2010, 10:48:22 AM11/30/10
to django-lfc
PS: I have 6 products only to sell, and 4 subscription services. So I
believe that I do not need all the power of LFS

jarik

unread,
Dec 1, 2010, 7:05:59 AM12/1/10
to django-lfc
Well, I tried to mix LFS and LFC. My results are here
https://github.com/jardev/lfs-lfc-installer.
It was not hard to mix them together. The troubles were:
- django-portlets. LFS 0.5.0b6 uses version 1.0b6. LFC 1.0.2 uses
>=1.0,<1.1
- File classes with relations to ContentType. Both lfc.models.File
and lfs.catalog.File use related_name 'files' for ContentType
- There are duplicates for Slots (Left, Right, Left, Right)
I did as I wrote in Troubleshoots section in
https://github.com/jardev/lfs-lfc-installer/blob/master/README

Now I have:
127.0.0.1:8000/ - CMS
127.0.0.1:8000/manage - Management for CMS
127.0.0.1:8000/shop/manage - Management for LFS
127.0.0.1:8000/shop/* - URLs for LFS

I have all portlets from LFC and LFS together so I can easily
integrate the shopping cart on my pages, or show products on some
other pages.

I don't like this my Troubleshoots-section. It's working for me now as
a workaround. But I want to have a more general solution without that
patches.
If someone wants to help me, you're welcome! For my part I'll do my
best.

PS: Continue to experiment. If someone interested in, I'll post here
my results


On Nov 30, 4:36 pm, jarik <jar...@gmail.com> wrote:

eryx67

unread,
Dec 30, 2010, 5:03:29 AM12/30/10
to djang...@googlegroups.com
Good day,

I have a strange problem with this LFC+LFS integration.

If I use LFC urlpatterns as is I can't view categories, `lfs.catalog.views.category_view' is not called:

http://localhost:8000/shop/category-c1 -> 404 response

If I change lfc.core.urls.urlpatterns (str 36) from:
# Catalog
urlpatterns += patterns('lfs.catalog.views',
    url(r'^category-(?P<slug>[-\w]*)$', "category_view", name="lfs_category"),
    ...
to:

# Catalog
urlpatterns += patterns('lfs.catalog.views',
    url(r'^category-(?P<category_slug>[-\w]*)$', "category_view", name="lfs_category"),
    url(r'^category-(?P<slug>[-\w]*)$', "category_view", name="lfs_category"),  
    ...
and lfs.catalog.views.category_view (str 236) from:

def category_view(request, slug, template_name="lfs/catalog/category_base.html"):
    """
    """
    ...
to:

def category_view(request, slug = None, category_slug = None, template_name="lfs/catalog/category_base.html"):
    """
    """
    if not slug:
        slug = category_slug
    ...

all is fine.

Sorry but I can't find the problem by myself because my Django experiences are 6 hours only.

Best Regards,
Vladimir Sekissov

xz

unread,
Jan 24, 2011, 9:02:30 AM1/24/11
to django-lfc
solution:

file: lfc/utils/middleware.py
+import re

in LFCMiddleware.process_view

+#LFС-LFS patch
+if re.match('^/shop/', request.get_full_path()):
+return
Reply all
Reply to author
Forward
0 new messages