Code Monkey home page Code Monkey logo

django-cart's People

Contributors

bmentges avatar caroso1222 avatar chehst avatar dfalk avatar furins avatar joaovitorsilvestre avatar jordij avatar mensaah avatar michaelavila avatar sanjaykrishnan avatar tfyr avatar vodopyanovas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-cart's Issues

Warning about django.contrib.contenttypes deprecation

/myapp/lib/python2.7/site-packages/cart/models.py:4: 
RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and 
will be removed in Django 1.9. Its contents have been moved to the fields, forms, 
and admin submodules of django.contrib.contenttypes.
  from django.contrib.contenttypes import generic

Just to warn

Change the license?

This is an extract of the GPLv3 license:

"The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License."

I believe this cart library will be more useful if you change the license to LGPL. So can I ask you to change it or, if you don't like this idea, can I have your blessing to release a modified version of it under LGPL?

ImportError: cannot import name 'Cart'

Running Python 3.4.3 and Django 1.9.5 (inside a virtualenv environment), I get the following error when running python manage.py makemigrations (I'm not using South):

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/caleb/projects/dev/lib/python3.4/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/home/caleb/projects/dev/lib/python3.4/site-packages/django/core/management/__init__.py", line 327, in execute
    django.setup()
  File "/home/caleb/projects/dev/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/caleb/projects/dev/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/caleb/projects/dev/lib/python3.4/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/home/caleb/projects/dev/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/caleb/projects/dev/lib/python3.4/site-packages/cart/__init__.py", line 1, in <module>
    from cart import Cart, ItemAlreadyExists, ItemDoesNotExist
ImportError: cannot import name 'Cart'

The INSTALLED_APPS section of settings.py looks like this:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'cart',
]

django-cart was installed via pip install django-cart

when migrate I got this error .

File "/usr/local/lib/python3.5/dist-packages/cart/cart.py", line 2, in
import models
ImportError: No module named 'models'

Model imports

Hey, you may have done a model import the wrong way in cart.py , I'm using python3 and Django 1.9.7

update does nothing

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

may be
else: #ItemAlreadyExists
item.unit_price = unit_price
item.quantity = int(quantity)
item.save()

Pypi package outdated

Hello there,

Installing django-cart using pip I've noticed that the pypi repo has an outdated version: cart.py.clear method is broken there, while here (github) the issue is already fixed.
Would you mind pushing an updated version?

Many thanks!

Warning about Item model

/myapp/lib/python2.7/site-packages/cart/models.py:26: RemovedInDjango19Warning: 
Model class cart.models.Item doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. 
This will no longer be supported in Django 1.9.
  class Item(models.Model):

Any suggested solution?

project dead? django-changuito to the rescue

Seems that this project is sort of dead, several forks have been made .. even I started one https://github.com/angvp/django-changuito with some improvements I'd like to add some of my work there, but the process here seems to be slow, people who want to use a django-cart version with more features please give a try to django-changuito or let's make a deal with all the forks and make the next release of django-cart more complete and with more maintainers...

What do you think?

Couple of questions

Hi,
I have 2 questions:

  1. Is this project still maintained?
  2. why is the cart linked to the session, and not to the user? When the session expires or the user logs out, the cart is 'lost'... I understand that not all users can be authenticated, so I can imagine that the cart must work independently, but then it also means there are plenty of 'dead' carts left once sessions are invalidated. In the different implementations I saw for this, the cart is always linked only to the session (even stored in the session object). I'm curious as to why?

Cool library though.

Problem with Python 3.* & Django 2.*

Hi
Thank you for making this very useful and awesome library.
There are certain issues with this when we try to use it with python 3.* and django 2.*
We have found the fix for it, please apply these fixes so that we don't have to edit the two files everytime we install this.

* Bug fix with the django cart package
* Update file site-packages/cart/cart.py
At line 2
- *from . import models* in place of the import declaration.

and

*** Update file site-packages/cart/models.py
At line 27
replacement: cart = models.ForeignKey(Cart, verbose_name=_('cart'), on_delete=models.CASCADE)
At line 31
replacement: content_type = models.ForeignKey(ContentType,  on_delete=models.CASCADE)

Migration Error

Am encountering the following issue when trying to migrate:

(virtual) erick@rick:~/Documents/personal projects/gift a box$ ./manage.py migrate Traceback (most recent call last): File "./manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/erick/Documents/personal projects/gift a box/virtual/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line utility.execute() File "/home/erick/Documents/personal projects/gift a box/virtual/lib/python3.6/site-packages/django/core/management/__init__.py", line 347, in execute django.setup() File "/home/erick/Documents/personal projects/gift a box/virtual/lib/python3.6/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/home/erick/Documents/personal projects/gift a box/virtual/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate app_config.import_models() File "/home/erick/Documents/personal projects/gift a box/virtual/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/erick/Documents/personal projects/gift a box/virtual/lib/python3.6/site-packages/cart/models.py", line 26, in <module> class Item(models.Model): File "/home/erick/Documents/personal projects/gift a box/virtual/lib/python3.6/site-packages/cart/models.py", line 27, in Item cart = models.ForeignKey(Cart, verbose_name=_('cart')) TypeError: __init__() missing 1 required positional argument: 'on_delete'

Pypi is outdate

Not a code issue, but the pypi version of this seems to be quite far behind this github repo, and thus doesn't support django 1.9.

Could you please do a new release and publish it to pypi?

cart not tied to logged in user

def new(self, request):
    cart = models.Cart(creation_date=timezone.now())
    cart.save()
    request.session[CART_ID] = cart.id
    return cart

Creating a new cart does not tie cart to a logged in user.
Initialization of CartProxy provides the necessary checks to see if user exists but the actual cart creation as shown above does not accommodate those options. Was this intentional or does the user have to implement it?

Prevent grouping of items in cart

I've been using django-cart for a basic app to sell physical products. It's simple and has worked okay for me so far.

I'm now working on adding Gift Card products where the price is chosen by the customer. The model this is based off is just a one-off model to change the name/description/etc. Price is chosen on the detail page.

This presents a problem as when I add a gift card to the cart for $50, and subsequently add another to the cart for $100, the cart sees both items as $100 instead of creating a separate line item for each.

Is there a way for me to prevent this item from grouping together without having to create model entries for all available prices?

Version Issues

I am not sure if I AM the wrong part, but it seems that the cart version available here is very different the one available when we run pip install Django-cart. The issues that come when you install it seems to be fixed already here, but not for installation. I am trying to deploy my app to HEROKU and when it runs the installation of the requirements, it comes with all the errors. Am I doing something wrong??
Thank you

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.