class Category
...
def get_absolute_url(self):
return reverse(
'catalog:product_list_by_category',
kwargs={'category_slug': self.slug}
)
class Product
...
def get_absolute_url(self):
return reverse(
'catalog:product_detail',
kwargs={
'product_slug': self.slug,
'category_slug': self.category.slug
}
)
using System;
class TwoArray
{
static void Main()
{
int[,] numbs = new int[3, 5];
Random rand = new Random();
int[,] numbs2 = new int[5, 3];
for (int i = 0, z = 0; i < numbs.GetLength(0); i++)
{
for (int j = 0; j < numbs.GetLength(1); j++, z++)
{
numbs[i, j] = rand.Next(0, 100);
Console.Write(numbs[i, j] + " ");
}
Console.WriteLine();
}
Console.WriteLine();
for (int i = 0; i < numbs2.GetLength(0); i++)
{
for (int j = 0; j < numbs2.GetLength(1); j++)
{
numbs2[i, j] = numbs[j, i];
Console.Write(numbs2[i, j] + " ");
}
Console.WriteLine();
}
Console.ReadKey();
}
}