Re: django model method

2023-02-09 Thread Vitaly Bogomolov
You can look towards  Django Q-objects 

. 

This filtering method is implemented in the MultiChoiceExt filter 
 of my 
DjangoAdminFilters library for using in Django admin.

For filtering in regular Django views, you can use this code as a starting 
point.

четверг, 9 февраля 2023 г. в 16:21:24 UTC+4, Chelsea Fan: 

> understood, is there any way to filter objects by method value?
>
> On Thu, Feb 9, 2023 at 4:42 PM Andréas Kühne  
> wrote:
>
>> No.
>>
>> Ordering works by using the database to order the models. It therefore 
>> needs to be a database field - otherwise the database can't order by the 
>> field?
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tors 9 feb. 2023 kl 12:09 skrev Chelsea Fan :
>>
>>> hello guys, Is it possible to use model method value to ordering model 
>>> objects in meta class?
>>>
>>> class Post(models.Model):
>>> title = models.CharField(max_length=255, verbose_name="ady")
>>> text = RichTextField(verbose_name="text")
>>> tagList = models.ManyToManyField(Tag, verbose_name="taglar", 
>>> related_query_name="tagList")
>>> image = models.ImageField(upload_to="postImage/", verbose_name=
>>> "surat")
>>> seen = models.ManyToManyField(UserId,verbose_name="görülen sany", 
>>> blank=True, related_name="gorulen")
>>> like = models.ManyToManyField(UserId,verbose_name="like sany", blank
>>> =True)
>>> share = models.PositiveIntegerField(verbose_name="paýlaşylan sany", 
>>> null=True, blank=True, default="0")
>>> createdAt = models.DateTimeField(auto_now_add=True, 
>>> verbose_name="goşulan 
>>> güni")
>>>
>>> class Meta:
>>> verbose_name_plural="Makalalar"
>>> # ordering = ("-createdAt",)
>>> ordering = ["-hotness",]
>>>
>>> def __str__(self):
>>> return self.title
>>>
>>> def likes(self):
>>> return self.like.count()
>>>
>>> likes.short_description = "Like sany"
>>> likes.allow_tags = True
>>>
>>> def seens(self):
>>> return self.seen.count()
>>>
>>> seens.short_description = "Görülen sany"
>>> seens.allow_tags = True
>>>
>>> @property
>>> def hotness(self):
>>> return self.likes() + self.seens() + self.share
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAJwZndfmes4g2KWUB3Fz6wNRORQ40Fxj_NYwYKWCF6DX96OVyg%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAK4qSCfpaVQ1YXMbVae26RLgsYYBcLRMcpgQOEm9z3%2B6NpN5Ww%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/12296d6e-69f3-4f4b-8c12-2bc7ac141ba8n%40googlegroups.com.


Re: Dashboard with plotting graph

2023-06-21 Thread Vitaly Bogomolov
I like https://dygraphs.com/

It's lightweight and have all option for common plots.

среда, 21 июня 2023 г. в 04:53:09 UTC+4, DieHardMan 300: 

> Hello, I hope everyone have a good day. I want to start building dashboard 
> with the plotting graph in my Django 4.2 web application. So I want some 
> recommendations of what libraries should I use or what libraries work best 
> for you guys.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b48882f4-54b0-4579-907f-a2b53f67749en%40googlegroups.com.


Re: logging admin accesses

2023-12-15 Thread Vitaly Bogomolov



Is that programically accessible? I want to record it in the database. 


from django.contrib.admin.models import LogEntry

logs = LogEntry.objects.all() #or you can filter, etc.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a8cdb111-6e53-4dc5-b014-510ff07e1187n%40googlegroups.com.


Re: Agricultural and livestock project using python, django and next technologies.

2024-02-19 Thread Vitaly Bogomolov
Hi I am interested

https://github.com/vb64


I wrote  about the same thing before but I only sent the title XD.
The project:

I'm working on an interesting project that I think might interest you. This 
is an online market similar to farmers' and ranchers' markets in the US, 
but with an online focus. The project is going to be redone from scratch 
because I had many mistakes when I made the MVP, I have a very specific 
backlog on how to do everything.

Technologies:

We are using Python and Django for the backend, and Next.js for the 
frontend.




Why collaborate:

You will learn a lot - the project is well organized and will allow you to 
work with modern and relevant technologies.
You will contribute to a real project: Your work will have a direct impact 
on the success of the project.
You will be part of a community: We are a passionate team committed to the 
success of the project.
How can you participate?
I keep the repository private because I don't like people gossiping: 
https://github.com/Programacionpuntera/Marketplace-again
so I will need to know your github user to add you. I have also created a 
WhatsApp group to synchronize on pending tasks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef8c27da-be76-41d0-95dc-5e509a043073n%40googlegroups.com.


Re: Any open source SMS?

2024-03-08 Thread Vitaly Bogomolov
Hi


Our use case: 
We need to generate OTP code to users upon signup in our application. 


You can take a look at my solution to this task for Django:

https://github.com/vb64/django.admin.auth.emailpin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6a2c7762-43cb-4312-9e53-ce6d37a6b3a7n%40googlegroups.com.