[ckan-discuss] Resource Name

Ganti, Anita - ARS Anita.Ganti at ARS.USDA.GOV
Tue Dec 17 15:09:15 UTC 2013


I would like to know if anybody has tried to make the Resource Name " Mandatory".
I have completed the following steps:

I have edited the model/resource.py
From
Column('name', types.UnicodeText)
To
Column('name', types.UnicodeText, nullable=False)

I assumed the following  would work, but it does not give me expected results:--

if data_dict['resources'] and  request.params.get('name') =='':
                     # NO NAME SO KEEP ON THE PAGE
                    h.flash_error(_('You must add a Name for the resource'))
                    redirect(h.url_for(controller='package',action='new_resource', id=id))

Any help would be greatly appreciated.


Regards,
Anita





This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/pipermail/ckan-discuss/attachments/20131217/6c7943c7/attachment.html>


More information about the ckan-discuss mailing list