Giter VIP home page Giter VIP logo

django-cart's People

django-cart's Issues

ItemManager.get() not working

What steps will reproduce the problem?
cart_manager = CartManager(request)
cart_manager.add(someitem)
item_manager = ItemManager()
item_manager.get(product=someitem)

What is the expected output? What do you see instead?
I would expect to have the item returned, instead I get:
'NoneType' object has no attribute '_meta'
which is traced back to this line of code:
return super(ItemManager, self).get(*args, **kwargs) 

I get the same error on my Mac OSX or ArchLinux.


Original issue reported on code.google.com by [email protected] on 14 Dec 2010 at 9:58

No way to contact or contribute?

I would like to push some of my changes back, as I've managed to get the basic 
functionality 
working for updating and clearing the cart. I couldn't find a way to contact 
the project owner or 
request membership.

Original issue reported on code.google.com by [email protected] on 14 Apr 2009 at 7:40

Table cart pollutes database

Hy, I have a very problem. When the User enters the site, django-cart create 
a table cart in database, but if the User leave the site, the table cart is 
still there. If a thousand users entering and leaving the site, the database 
will be very polluted, this is a serious problem because as I do to remove 
the table cart from the database when the User leave the site?

Original issue reported on code.google.com by [email protected] on 1 Mar 2010 at 8:09

I think, this is good idea!

models.py:

class Item(models.Model):
    cart = models.ForeignKey(Cart, verbose_name=_('cart'))
    quantity = models.PositiveIntegerField(verbose_name=_('quantity'),
default=1)
    ....

cart.ry:

class Cart:
    ...
    def add(self, product, unit_price, quantity=None):
        try:
            item = models.Item.objects.get(
                cart=self.cart,
                product=product,
            )
        except models.Item.DoesNotExist:
            item = models.Item()
            item.cart = self.cart
            item.product = product
            item.unit_price = unit_price
            if quantity: item.quantity = quantity
            item.save()
        else:
            raise ItemAlreadyExists

...

    def update(self, product, quantity, unit_price=None):
        try:
            item = models.Item.objects.get(
                cart=self.cart,
                product=product,
            )
            item.quantity = quantity
            if unit_price: item.unit_price = unit_price
            item.save()
        except models.Item.DoesNotExist:
            raise ItemDoesNotExist

Original issue reported on code.google.com by ivan%[email protected] on 12 Jan 2010 at 5:41

License disallows viewing

GPL'd code in the Django community is really annoying. This code looks
useful from the overview, but I really shouldn't look at GPL'd code because
I work on code that is closed source that may implement similar
functionality. Django is BSD licensed, and more permissive licenses are
much more useful to the community.

Original issue reported on code.google.com by [email protected] on 14 Jun 2009 at 8:41

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.