[ckan-discuss] lowercase file formats

David Read david.read at hackneyworkshop.com
Mon Mar 19 09:14:09 GMT 2012


Not at all, it just didn't suit our usecases. Always good to try lots
of things like this.

Dave

On 19 March 2012 09:01, Rufus Pollock <rufus.pollock at okfn.org> wrote:
> Yes, just to clarify this was originally *my* suggestion (to force
> lowercase) so if it was anyone's error is was mine :-)
>
> Rufus
>
> On 16 March 2012 18:15, Tom Rees <zephod at gmail.com> wrote:
>> I did ask about this one, the ticket was very vague about what the goal of
>> the exercise was, and I thought my solution was a bit hacky. I was right :-)
>>
>>
>> On Fri, Mar 16, 2012 at 5:09 PM, David Read <david.read at hackneyworkshop.com>
>> wrote:
>>>
>>> Great, many thanks, I've pushed it here: [release-v1.6.1 6696b9a]
>>>
>>> I'll hope to get round to my improved autocomplete idea soon and will
>>> see what you think.
>>>
>>> Dave
>>>
>>> On 16 March 2012 16:48, David Raznick <kindly at gmail.com> wrote:
>>> > Hello,
>>> >
>>> > Yes that is fine, Tom added it and I approved without thinking through
>>> > all the consequences.
>>> >
>>> > David
>>> >
>>> > On Fri, Mar 16, 2012 at 4:23 PM, David Read
>>> > <david.read at hackneyworkshop.com> wrote:
>>> >> Rufus has just suggested to me that we simply remove (revert) the
>>> >> lowercase functionality for now. David Raznick, does that suit?
>>> >>
>>> >> David
>>> >>
>>> >> On 16 March 2012 14:46, David Read <david.read at hackneyworkshop.com>
>>> >> wrote:
>>> >>> On 16 March 2012 13:17, Rufus Pollock <rufus.pollock at okfn.org> wrote:
>>> >>>> On 16 March 2012 11:36, David Read <david.read at hackneyworkshop.com>
>>> >>>> wrote:
>>> >>>>> I notice that file formats are now automatically changed to lower
>>> >>>>> case, whatever you type in. I can see this is useful to stop the
>>> >>>>> database ending up with both 'CSV' and 'csv', but I think capitals
>>> >>>>> are
>>> >>>>> often important. e.g. our database has RDFa, iCal, netCDF, Flash
>>> >>>>> Player and having this hard-coded in the logic layer is a rather
>>> >>>>> inflexible. And what if on our site we'd prefer CSV to csv? Also, it
>>> >>>>> doesn't seem right to do this conversion without telling you *after*
>>> >>>>> you submit the form.
>>> >>>>
>>> >>>> Got you. I guess the issue is you end up with a lot CSV vs csv in the
>>> >>>> DB. What about netCDF versus netcdf or Flash versus flash. At least
>>> >>>> for faceting it is clear we need to standardize. So options are:
>>> >>>>
>>> >>>> * Don't change the format you are given (but then standardize into
>>> >>>> the
>>> >>>> faceting in SOLR?)
>>> >>>> * Change stuff to lower case (not liked but standardized)
>>> >>>>
>>> >>>>> How about just having format autocomplete with some well-known
>>> >>>>> formats, or convert only well-known formats (e.g. csv, xls) to
>>> >>>>> lower/uppercase, rather than the whole lot?
>>> >>>>
>>> >>>> Autocomplete just runs off whole list of existing formats at the
>>> >>>> moment. Autocompleting based on specific formats would add more
>>> >>>> complexity (so if you wanted that change we might want to remove full
>>> >>>> autocomplete).
>>> >>>
>>> >>> Yes, exactly. Mostly we care about the top 10 formats. In the meantime
>>> >>> to us getting round to this different auto-complete option, do you
>>> >>> mind if I make the code that forces it to lower case format
>>> >>> configurable to off?
>>> >>>
>>> >>> Dave
>>> >>>
>>> >>>>
>>> >>>> Sounds like this is all ticketable and real questoin is then cost /
>>> >>>> benefit of this versus other features :-)
>>> >>>>
>>> >>>> rufus
>>> >>>>
>>> >>>>> Dave
>>> >>>>>
>>> >>>>> commit da3edd4371e381c2a631578938e878a2cf612bd9
>>> >>>>> Author: Tom Rees <zephod at gmail.com>
>>> >>>>> Date:   Tue Feb 28 18:26:31 2012 +0000
>>> >>>>>
>>> >>>>>    [#1506]: Force format field to be lowercase in resources.
>>> >>>>>
>>> >>>>> diff --git a/ckan/lib/dictization/model_dictize.py
>>> >>>>> b/ckan/lib/dictization/model_
>>> >>>>> index 309350e..1e1475e 100644
>>> >>>>> --- a/ckan/lib/dictization/model_dictize.py
>>> >>>>> +++ b/ckan/lib/dictization/model_dictize.py
>>> >>>>> @@ -79,6 +79,7 @@ def extras_list_dictize(extras_list, context):
>>> >>>>>
>>> >>>>>  def resource_dictize(res, context):
>>> >>>>>     resource = table_dictize(res, context)
>>> >>>>> +    resource['format'] = resource.get('format','').lower()
>>> >>>>>     extras = resource.pop("extras", None)
>>> >>>>>     if extras:
>>> >>>>>         resource.update(extras)
>>> >>>>>
>>> >>>>> _______________________________________________
>>> >>>>> ckan-discuss mailing list
>>> >>>>> ckan-discuss at lists.okfn.org
>>> >>>>> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> --
>>> >>>> Co-Founder, Open Knowledge Foundation
>>> >>>> Promoting Open Knowledge in a Digital Age
>>> >>>> http://www.okfn.org/ - http://blog.okfn.org/
>>>
>>> _______________________________________________
>>> ckan-discuss mailing list
>>> ckan-discuss at lists.okfn.org
>>> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>>
>>
>>
>> _______________________________________________
>> ckan-discuss mailing list
>> ckan-discuss at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>>
>
>
>
> --
> Co-Founder, Open Knowledge Foundation
> Promoting Open Knowledge in a Digital Age
> http://www.okfn.org/ - http://blog.okfn.org/



More information about the ckan-discuss mailing list