Giter Site home page Giter Site logo

1.3 findings about datashift_spree HOT 3 CLOSED

autotelik avatar autotelik commented on August 9, 2024
1.3 findings

from datashift_spree.

Comments (3)

autotelik avatar autotelik commented on August 9, 2024

Hi Jupiter

The thing with sku and cost price is that they are actually on the Variant class

and are only delegated methods on Product rather than real DB columns
hence why the don't currently show up

in the spec/fixtures directory are lots of example csv/excel files that are good basis for the Spree imports
especially if you want to create taxons, properties etc on the fly

On the error, looks like a bug in datashift so first I'd try with the latest from github so

in your Gemfile use

gem 'datashift', :git => 'http://github.com/autotelik/datashift'
gem 'datashift_spree', :git => 'http://github.com/autotelik/datashift_spree'

if still an issue would you mind sending me the first few  lines of the csv file ?

cos it looks to be failing where it tries to assign a value from a column so need to

work out how to handle that data properly

I need more real world cases so many thanks for the feedback, really helps improve things

cheers
tom
From: Jupiter Jones [email protected]

To: autotelik/datashift_spree [email protected]
Sent: Thursday, 20 December 2012, 3:35
Subject: [datashift_spree] 1.3 findings (#8)

Hello,
This is my first time using data shift, and I'm wanting to migrate products from a spree 1.2.2 site to test a new 1.3 site. Please excuse any basic misunderstandings :)
I've installed a spree 1.3 site and run both a datashift:generate:excel and datashift:export:excel on Spree:Product
Neither of these files contained a sku or a price column, so attempting to import the empty exported file generates the error:
ERROR: Mandatory column missing - expected column 'sku'
ERROR: Mandatory column missing - expected column 'price'
When I manually add the columns to the generated and exported file and re-import I get:
Loading from CSV file: export.xls
Processing 1 rows
/Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/datashift/method_detail.rb:147:in is_a?': class or module required (TypeError)
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/datashift/method_detail.rb:147:inassign'
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/loaders/loader_base.rb:381:in process'
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift_spree-0.3.0/lib/loaders/spree/product_loader.rb:109:inprocess'
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/loaders/csv_loader.rb:67:in `block (3 levels) in perform_csv_load'
etc...
Am I missing something simple here? Or will this plugin need updating to support 1.3?
Thanks for the great work. This is one of those essential plugins so I really appreciate the work you've done on it to date.
Thanks for your time.
Cheers,
Jupiter

Reply to this email directly or view it on GitHub.

from datashift_spree.

JupiterJones avatar JupiterJones commented on August 9, 2024

Hi Tom,

Thanks - much appreciated.

I've not got the import working nicely :)

I don't think this is the right place for semi-related questions, but here goes...

The docs mention a -c configFile option and specify # Configuration file containg defaults or over rides in YAML

Can you point me to the docs for the options and format of this file?

Bottom line - the import worked perfectly, however the images were not sized correctly. I was wondering how to provide that info to the importer.

Thanks again.

Cheers,

Jupiter

from datashift_spree.

autotelik avatar autotelik commented on August 9, 2024

ok glad that worked. I'll get a new version of the gem released

Not really any good docs on config yet  .. just https://github.com/autotelik/datashift/wiki/Import-facilities

This enables you to over ride the values of database fields during the import but
the Image dimensions cannot be set via this type of config anyway.

They are part of the paperclip definition(has_attached_file) for Images - held in the Spree::Image class

To change these generally what you need to do is create a decorator : models/spree/image_decorator.rb

copy the whole has_attached_file definition from the spree core code and then set the dimensions
 that you want for each style used by Spree .. for example

module Spree

  Image.class_eval do
    has_attached_file :attachment,
     :styles => {  :mini => '120x1020>', :small => '180x180>', :product => '340x340>', :large => '600x600>' },
      :default_style => :product,
      :url => '/spree/products/:id/:style/:basename.:extension',
      :path => ':rails_root/public/spree/products/:id/:style/:basename.:extension'
  end

end

hope that helps

cheers
tom


From: Jupiter Jones [email protected]
To: autotelik/datashift_spree [email protected]
Cc: tom statter [email protected]
Sent: Friday, 21 December 2012, 4:42
Subject: Re: [datashift_spree] 1.3 findings (#8)

Hi Tom,
Thanks - much appreciated.
I've not got the import working nicely :)
I don't think this is the right place for semi-related questions, but here goes...
The docs mention a -c configFile option and specify # Configuration file containg defaults or over rides in YAML
Can you point me to the docs for the options and format of this file?
Bottom line - the import worked perfectly, however the images were not sized correctly. I was wondering how to provide that info to the importer.
Thanks again.
Cheers,
Jupiter

Reply to this email directly or view it on GitHub.

from datashift_spree.

Related Issues (20)

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.