Hello everyone,
I have a model that contains alphanumeric protein names e.g. ('Ypp1Aa100").
I have to properly sort it when returning the contents to the html. I found
some fantastic sorting examples from this blog post
https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/. I
have
models.py
class product_list(models.Model):
date=models.DateTimeField(auto_now_add=True,null=True)
deal=models.ForeignKey(dealForm, null=True, blank=True , on_delete
=models.CASCADE)
pro_name=models.ForeignKey(wareForm, null=True, on_delete=models.CASCADE)
For Chinese programmers,it's money
Tanjina Sharmin 于2021年9月3日周五 下午8:25写道:
> def path_and_renamecsv(instance, filename):
> upload_to = 'attendancesheet'
> ext = filename.split('.')[-1]
> # get filename
> if instance.pk:
> filename = '{}.{}'.format(instance.pk, ext)
> else:
> # set filename as
3 matches
Mail list logo