Cannot save property group to product in django-lfs - django

I already create properties and add them to property group.Then I assign to my new product.But django show me
TypeError at /manage/update-product-properties/1
save() got an unexpected keyword argument 'using'

Yeah, as you point out in your comment to your OP, the problem went away by using a different version of Django. using is part of the machinery for multi-database support in Django 1.2

Related

Django 2.1 - 'WhereNode' object has no attribute 'output_field' error

I am trying to filter some annotations in a ViewSetlike so:
queryset = Confirmation.objects.values('prediction__specimen_id').annotate(
sample_id=F('target_prediction__specimen_id'),
num_selected=Count('selected', filter=Q(selected=True)),
num_validated=Count('validated', filter=Q(validated=True)),
num_has_standard=Count('has_standard', filter=Q(has_standard=True)))
However, I am getting the following error:
'WhereNode' object has no attribute 'output_field'
My syntax seems to be correct according to all guides. I am running Django 2.1. Any idea what's happening? Can I not do this in Django Rest Framework because of paging?
Looks like syntax was indeed the issue. My answer has been edited to include the correct code. Cheers!

ActiveModel::MissingAttributeError (can't write unknown attribute `price_cents`): error after rails upgrading to rail 5.1

I have upgraded my rails app which was earlier on rails 4.1 to rails 5.1.
Now I am getting an error while using acts_as_shopping_cart gem, which is on version 0.4.1
I tried many things but not sure why exactly I am getting this error, while adding item to cart
ActiveModel::MissingAttributeError (can't write unknown attribute price_cents):
app/models/shopping_cart.rb:11:in add
app/controllers/shopping_carts_controller.rb:38:in add_to_cart
Any suggestions on this, will be appreciated. Thanks in advance
this one is still not yet supported for Rails 5 https://github.com/crowdint/acts_as_shopping_cart, you could try this one https://github.com/dabit/acts_as_shopping_cart
Late reply, but I was banging my head on this one for too long so I thought this may help other people.
You're getting the MissingAttributeError because your shopping_carts table doesn't have a price_cents field. The previous version of acts_as_shopping_cart (~ 0.2.2) was setup to use a float field called price, and it did not use the money-rails gem. The newer versions (>= 0.4.0) use money-rails and an integer field called price_cents, then money-rails "automagically" creates a attribute called "price" that converts to/from the price_cents field.
You may be able to migrate your price field using one of their helpers:
https://github.com/RubyMoney/money-rails#migration-helpers

Django Create Custom Error Report

I want to modify the default Django error reporting template TECHNICAL_500_TEXT_TEMPLATE to provide custom error message. Read doc on modifying the filter tried
DEFAULT_EXCEPTION_REPORTER_FILTER = 'path.to.your.CustomExceptionReporterFilter' but it's about filtering data but I would like to override the default template itself.
Tried overriding DEFAULT_EXCEPTION_REPORTER_FILTER and defining custom get_traceback_text and hence passing custom template instead of TECHNICAL_500_TEXT_TEMPLATE in the method.
Any suggestions would be helpful
I started noticing the change in the emails after upgrading from 1.7 to 1.9. I used the approach in the following answer. I basically removed the 'settings' section from the templates, including a few other lines that weren't needed.
Django error email is too long. How do I truncate it?

django SplitDateTimewidget deprecated

I'm using widgets.AdminSplitDateTime in a create view that is corresponding to a datetime field.
When I try to create the object it gives me the following error:
RemovedInDjango19Warning: Using SplitDateTimeWidget with DateTimeField is deprecated. Use SplitDateTimeField instead.
I have searched the web for an answer about how to use it but I couldn't find anything that works..
I tries to change the widgets.AdminSplitDateTime to forms.SplitDateTimeField and it gave me the following error:
'SplitDateTimeField' object has no attribute 'is_hidden'
can someone help me on figuring out how to use it?

'module' object has no attribute 'form_for_model'

When I am using attribute
form_for_model
I am getting an error module object has not attribute form_for_model..
I created the project from this http://www.mikecantelon.com/?q=node/22
but I am getting the above can any body help me
The post you are referring to is fairly old (2007) and a few things have changed since then:
form_for_model is deprecated.
I'd say you are better off looking at the official tutorial to get started with django.
The current way for creating forms based on models is explained in this part of the docs:
http://docs.djangoproject.com/en/1.8/topics/forms/modelforms/