好 slug是要全部小写吗?


On Sat, Dec 7, 2013 at 12:16 AM, Greg Wang <notifications@github.com> wrote:

> In management/shop/item.py:
>
> > +          # Add Item attributes according to column index
> > +          if value == name_index:
> > +            item.name = row[name_index]
> > +          elif value == category_index:
> > +            catParent = ''
> > +            result = re.split('->', row[category_index])
> > +            # Split up Category content, iterate from top layer
> > +            for catName in result:
> > +              if not Category.objects.filter(name=catName).exists():
> > +                # If no such Category exists
> > +                if not catParent=='':
> > +                  # Category don't have a parent
> > +                  p = Category.objects.create(name = catName, store = Store.objects.get(name = store_name),
> > +                      parent = Category.objects.get(name = catParent))
> > +                else:
> > +                  p = Category.objects.create(name = catName, store = Store.objects.get(name = store_name))
>
> 这个if的逻辑没太懂...或者是comment不太对, 是if category have a parent?
> 另外, Category好像也有slug吧, 要弄一下.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/gregwym/fruitex/pull/16/files#r8180391>
> .
>