Hi,
Sorry for the late reply, very busy weekend.
Here is my code to bulk update price. Please add this into any of your app
models.py and admin.py
I have an app called storeoptions where I stick all these in.
Here is the model, I create a proxy class for it so I can easily define the
ordering and other customization.
"""
class PriceUpdate(Price):
class Meta:
proxy = True
ordering = ['product','expires']
"""
Here is the admin class
"""
class PriceUpdateAdmin(admin.ModelAdmin):
list_display = ['product','price','quantity','expires']
list_editable = ['price','expires','quantity']
search_fields = ['product__name','product__sku']
admin.site.register(PriceUpdate, PriceUpdateAdmin)
"""
That's all. once you have that you will be able to bulk edit the price for your
products
Hope it helps
lzantal
On Jan 16, 2012, at 1:10 AM, ionic drive wrote:
> sorry to all about this mess.
> I have pressed the reply button and changed the topic. I thought this will
> create a new topic.
> I promise to write directly to satchmo-users email address in the future.
> Sorry!
>
> @hynekcer,
> thank you again for the input and help!
> Have to rethink my strategy.
> Izantal was writing that he is doing similar stuff, maybe he can teach me how
> to do it correctly.
>
> Best wishes
> ionic
>
> On Sun, 2012-01-15 at 14:49 -0800, hynekcer wrote:
>> I think that it requires sometimes to write a view. Imagine that you
>> have a price valid until today and you want to edit prices which will
>> be valid tomorow. You need to write a filter, which unit_price you
>> really want to edit.
>>
>> On 15 led, 14:31, mister wong <[email protected]> wrote:
>> > hello Lazlo and friends,
>> >
>> > what I have done so fare:
>> > 1)
>> > (searching the web ;-) )
>> >
>> > 2)
>> > added to:
>> > class ProductOptions(admin.ModelAdmin):
>> > ...
>> > list_editable('item_in_stock', )
>> >
>> > this works great for updating item_in_stock in the list.
>> >
>> > But
>> > 3)
>> > how can the same effect be achieved on 'unit_price' as unit_price is not on
>> > the Product-model.
>> >
>> > This is not working:
>> > list_editable('item_in_stock', 'unit_price')
>> > the error message is:
>> > 'ProductOption.list_editable[1]' refers to a field, 'unit_price', not
>> > defined on Product.
>> >
>> > Please teach me the proper location to make 'unit_price' editable.
>> >
>> > Thank you in advance!
>> > ionic
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Sat, Jan 14, 2012 at 6:17 PM, ionic drive <[email protected]> wrote:
>> > > Thank you lzantal,
>> >
>> > > I was thinking about a solution similar to yours.
>> > > Thank you very much!
>> > > I will do exactly as you mentioned.
>> >
>> > > Best wishes
>> > > ionic
>> >
>> > > On Sat, 2012-01-14 at 09:01 -0800, Laszlo Antal wrote:
>> > > > Hi,
>> >
>> > > > I never delete a product since that would affect order history. What I
>> > > do is replace the default admin class for Product and add a new action
>> > > that sets active to False. This allow me to tick the checkmark on any of
>> > > the product and update them. As for price I have list_editable for the
>> > > price admin which allows me to edit price on the list_change page.
>> > > > I also added that for the product for inventory that gives an easy way
>> > > to update.
>> >
>> > > > Hope it helps
>> >
>> > > > lzantal
>> >
>> > > > On Jan 14, 2012, at 8:27, ionic drive <[email protected]> wrote:
>> >
>> > > > > Hello Satchmo-Friends,
>> >
>> > > > > how do you perform bulk actions such as:
>> > > > > ----------------------------------------
>> > > > > *quick price changes on a bunch of products.
>> > > > > *deleting multiple products at once.
>> >
>> > > > > without having to open each product item in admin area.
>> >
>> > > > > Thanks in advance
>> > > > > ionic
>> >
>> > > > > --
>> > > > > You received this message because you are subscribed to the Google
>> > > Groups "Satchmo users" group.
>> > > > > To post to this group, send email to
>> [email protected]
>> .
>> > > > > To unsubscribe from this group, send email to
>> > >
>> [email protected]
>> .
>> > > > > For more options, visit this group at
>> > >
>> http://groups.google.com/group/satchmo-users?hl=en
>> .
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Satchmo users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/satchmo-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.