2014-05-30 0:01 GMT+02:00 Dave Kuhlman <dkuhl...@davekuhlman.org>:

> On Wed, May 28, 2014 at 07:13:17PM +0200, Alessandro Pasotti wrote:
> > Hi,
>
>
> > I'm trying to generate Django models/forms for an xsd, Im getting
> > the a.m.  error with v. 2.12d
> >
> > This is the xsd (it is an official XSD for Italian gov. invoicing):
> >
> >
> http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.0/fatturapa_v1.0.xsd
> >
> > I've renamed the xsd to comply with python module naming (removed
> > the dot).
> >
> > I'm trying to follow step-by-step the instructions from this page:
> > http://www.rexx.com/~dkuhlman/generateDS.html#id75
> >
> > Any idea?
> >
> > Full tb:
> > Traceback (most recent call last):
> >   File "./gends_generate_django.py", line 146, in <module>
> >     main()
> >   File "./gends_generate_django.py", line 141, in main
> >     generate_model(options, module_name)
> >   File "./gends_generate_django.py", line 92, in generate_model
> >     cls.generate_model_(wrtmodels, wrtforms)
> > AttributeError: type object 'AllegatiType' has no attribute
> > 'generate_model_'
>
> Alessandro,
>
> Thanks for this report and the traceback.
>


Hi Dave,

Thank you  for your help!


> I just now ran a test with your XML schema, after changing the
> name to remove the dot (thanks for that hint).  I was able to
> successfully generate models.py, forms.py, and admin.py.
>
> So, I have not yet been able to reproduce this error.
>
> I have sent you the files I generated.  See below.
>
> One suggestion -- When you run this, we're using a special version
> of class GeneratedsSuper which contains generate_model_.  The file
> generated by generateDS.py contains a version  of that class, but
> it's overridden if there is a file named generatedssuper.py on your
> PYTHONPATH, and that's what we need it to do.  So, make sure that
> the version of generatedssuper.py that you copied from
> generateDS-xx.xx/django is actually being imported.



This is the first problem, having installed generateDS with pip (see below)
there is no "django" folder anywhere under virtualenv site packages.

I've found executables in the bin dir but there is no generatedssuper.py :

ls -la bin/gen*
-rwxrwxr-x 1 ale ale   9366 mag 28 17:21 bin/gends_extract_simple_types.py
-rwxrwxr-x 1 ale ale   3821 mag 28 18:04 bin/gends_generate_django.py
-rwxrwxr-x 1 ale ale   3799 mag 28 18:02 bin/gends_run_gen_django.py
-rwxrwxr-x 1 ale ale  94978 mag 28 17:21 bin/generateds_gui.py
-rwxrwxr-x 1 ale ale 254863 mag 28 17:21 bin/generateDS.py




> Try putting a
> print statement in that file or put a syntax error in it to make
> sure.
>
> Also, I notice that the line:
>
>      cls.generate_model_(wrtmodels, wrtforms)
>
> in file gends_generate_django.py is on a slightly different line in
> my version than yours -- line 90 in my file; line 92 in yours.  Is
> it possible that we have a version mis-match here?
>


I've tried to debug it and I've probably left newlines or comments after
having inserted pdb statements, I'm using the version installed in a
virtualenv by

pip install generateDS==2.12d


Also, please note that installing with "pip install generateDS" (without
the version) fails.



>
> Please let me know if I can be of more help and if there is
> something else I can do to try to reproduce that exception, or if
> you have suggestions, etc.
>
>

Yes, steps to reproduce:


1.create a virtualenv
2. pip install generateDS (fails)
3. pip install generateDS==2.12d
4. mkdir WorkDir
5. cd WorkDir
6. copy gen* files that were installed in your virtualenv bin directory
7. download xsd and rename to strip the dot
8. try to generate the django models/forms



-- 
Alessandro Pasotti
w3:   www.itopen.it
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to