Skip to content

Commit

Permalink
Fix of
Browse files Browse the repository at this point in the history
Traceback (innermost last):

    Module ZPublisher.Publish, line 138, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 48, in call_object
    Module plone.z3cform.layout, line 66, in __call__
    Module plone.z3cform.layout, line 50, in update
    Module plone.dexterity.browser.add, line 130, in update
    Module plone.z3cform.fieldsets.extensible, line 59, in update
    Module plone.z3cform.patch, line 30, in GroupForm_update
    Module z3c.form.group, line 145, in update
    Module plone.app.z3cform.csrf, line 21, in execute
    Module z3c.form.action, line 98, in execute
    Module z3c.form.button, line 315, in __call__
    Module z3c.form.button, line 170, in __call__
    Module plone.dexterity.browser.add, line 105, in handleAdd
    Module z3c.form.form, line 263, in createAndAdd
    Module pkan.dcatapde.browser.add_views.default_add_view, line 23, in create
    Module zope.component._api, line 220, in createObject
    Module pkan.dcatapde.content.catalog, line 143, in __call__
    Module pkan.dcatapde.api.catalog, line 19, in clean_catalog
    Module zope.schema._schema, line 54, in getValidationErrors
    Module zope.schema._schema, line 87, in getSchemaValidationErrors
    Module zope.schema._field, line 312, in bind
    Module Zope2.App.schema, line 33, in get
    Module plone.app.vocabularies.catalog, line 627, in __call__
    Module OFS.Traversable, line 118, in getPhysicalPath
    Module OFS.SimpleItem, line 112, in getId

AttributeError: This object has no id
  • Loading branch information
volkerjaenisch committed Jan 25, 2018
1 parent 88f879d commit 3fa3784
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/pkan/dcatapde/api/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def clean_catalog(**data):
"""Clean Catalogs."""
test_catalog = Catalog()

# test object must have an id
test_catalog.id = 'test'
test_catalog.title = 'test'

for attr in data:
setattr(test_catalog, attr, data[attr])

Expand All @@ -30,7 +34,6 @@ def add_catalog(context, **data):

return catalog


# Get Methods

# Delete Methods
Expand Down
4 changes: 4 additions & 0 deletions src/pkan/dcatapde/api/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def clean_dataset(**data):
"""Clean datasets."""
test_dataset = Dataset()

# test object must have an id
test_dataset.id = 'test'
test_dataset.title = 'test'

for attr in data:
setattr(test_dataset, attr, data[attr])

Expand Down
4 changes: 4 additions & 0 deletions src/pkan/dcatapde/api/dct_licensedocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def clean_dct_licensedocument(**data):
"""Clean dct_licensedocument."""
test_license = Dct_Licensedocument()

# test object must have an id
test_license.id = 'test'
test_license.title = 'test'

for attr in data:
setattr(test_license, attr, data[attr])

Expand Down
4 changes: 4 additions & 0 deletions src/pkan/dcatapde/api/dct_mediatypeorextend.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def clean_dct_mediatypeorextent(**data):
"""Clean dct_mediatypeorextent."""
test_obj = Dct_Mediatypeorextent()

# test object must have an id
test_obj.id = 'test'
test_obj.title = 'test'

for attr in data:
setattr(test_obj, attr, data[attr])

Expand Down
6 changes: 4 additions & 2 deletions src/pkan/dcatapde/api/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

# Data Cleaning Methods
def clean_distribution(**data):

test_obj = Distribution()

# test object must have an id
test_obj.id = 'test'
test_obj.title = 'test'

for attr in data:
setattr(test_obj, attr, data[attr])

Expand All @@ -26,7 +29,6 @@ def add_distribution(context, **data):

return dist


# Get Methods

# Delete Methods
Expand Down
4 changes: 4 additions & 0 deletions src/pkan/dcatapde/api/foafagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def clean_foafagent(**data):
"""Clean foafagent."""
test_obj = Foafagent()

# test object must have an id
test_obj.id = 'test'
test_obj.title = 'test'

for attr in data:
setattr(test_obj, attr, data[attr])

Expand Down
4 changes: 4 additions & 0 deletions src/pkan/dcatapde/api/harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def clean_harvester(**data):

test_obj = Harvester()

# test object must have an id
test_obj.id = 'test'
test_obj.title = 'test'

for attr in data:
setattr(test_obj, attr, data[attr])

Expand Down

0 comments on commit 3fa3784

Please sign in to comment.