Menu

#2 Flawed logic for categories and sub-categories

v1.0 (example)
open-accepted
None
5
2007-09-07
2007-05-14
Robert
No

There is logic in the code for looking up the smugmug "internal" categoryid number and subcategoryid number that is flawed.

line 236:

if re.match("\d+$",category_string):
return string.atoi(category_string)

and line 247:

if re.match("\d+$",subcategory_string):
return string.atoi(subcategory_string)

If the passed in "category" or "categoryid" is a number, the code assumes (never assume!!!!) that the user must be specifying a smugmug internal categoryid/subcategoryid number, and it does not do the proper lookup/mapping. (In my case, I have custom categories for 'Year' and custom subcategories for 'Month', all specified as digits!!!)

My suggestion? Have a different parameter for when one already knows that info, and doesn't want to do the lookup.

Discussion

  • Jesus Miguel Rodriguez

    • status: open --> open-accepted
     
  • Jesus Miguel Rodriguez

    Logged In: YES
    user_id=610559
    Originator: NO

    Glad folks are using some of the more advanced features of the script. I will investigate and post a proposed solution.

     
  • Jesus Miguel Rodriguez

    • assigned_to: nobody --> jmrodri
     

Log in to post a comment.