I have a situation where I need a CCK field to have a range of numbers which later on will be used for a lookup from an uploaded CSV file.
There are quite a few nodes which are set up as accounts which need to have these ranges applied. Generally speaking they are a range of 26 numbers, but it is possible there will be another 26 numbers added at a later date completely different to the first, but the first ones still need to be retained. Some situations may need as many as 78 numbers or even 104.
Once these numbers are associated with the account, every day a CSV file will be uploaded with some of these numbers. When it is uploaded, I will need to go down the file row by row (I can do this), and pick out the account which has that number in it's range.
The lookup is relatively easy, although may well be database heavy. The problem I have is how I get those numbers on to the accounts.
I was thinking of having a text CCK field and get the range in a format of 12345-12371, then on save I could get the range of that by splitting it with the - and creating an array then imploding making it comma seperated. Then for multiple ranges on one account, seperate them with a comma, so you could have 12345-12371,14789-14815, and split by the comma, then by the -. If I do this then I guess it would be best to use 2 fields, 1 for the user typed range and another for all the numbers to appear.
I just have a feeling that it will be slow and lock out the database for other queries as it is still on a live site. This would be done daily, except for weekends so it would end up being done 3 times on a Monday.
Comments
Try this module
http://drupal.org/project/range
And then just set Number of values: to Unlimited under Global Options (administer content types -> manage fields -> edit this field) - I'm assuming you can do it for this field (I tried with other cck field types).
Then you can just get it from the db, should be easy (all should have your nid).
Hope it helps.
Valentin
That's D6 only and with the
That's D6 only and with the site that this will be going on backported modules with insufficient testing is a negative.
James T
Action Medical Research - www.action.org.uk