Re: counting the same words within a song added by a user using Django

2021-07-09 Thread DJANGO DEVELOPER
https://stackoverflow.com/questions/41689274/split-multiple-selections-into-separate-records-in-a-django-model I also want the same result as it is mentioned here in the stackoverflow question On Fri, Jul 9, 2021 at 10:56 AM DJANGO DEVELOPER wrote: > sum it is giving me error of TextField is no

django...@googlegroups.com

2021-07-09 Thread saipushpak polepalle
{proto_opts,negotiate,negotiate,"/http-bind/", false,false,false,"/chat","binary",[],10,3,60, infinity,infinity,32768,32768,32768,32768,[],true, true},

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread 'Peter van der Does' via Django users
Overwrite the save method on the String model and when you hit save you split and save the words in the S_W_C model. This does mean when you update the String record all the words are added to the S_W_C model as well, as there is no correlation between the two model you don't know if that String wa

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread Tech Cue
*class String(models.model):* *string = models.textarea(null = True, blank = True)* > *user = models.ForeignKey(user, on_delete=models.CASCADE)* > *def __str__(self):* > *return self.string* > *class Song_Words_Count(models.model):* > *song = models.ForeignKey(user, on_del

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread Sebastian Jung
Hello Peter, ich would make it with a signal. Here a another example to use a post save signal: from django.db.models.signals import post_savefrom django.dispatch import receiver class TransactionDetail(models.Model): product = models.ForeignKey(Product) # method for updating@receiver(post_s

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread DJANGO DEVELOPER
Hi Peter, thanks for your reply. Sorry I have m2m relationship of User model with Song model and I am using m2m_changes signal for it but still not giving me the desired output. On Fri, Jul 9, 2021 at 9:20 PM Sebastian Jung wrote: > Hello Peter, > > ich would make it with a signal. > > Here a an

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread DJANGO DEVELOPER
hi Sebastian, do you know how can I resolve my problem? I want to count same words in a string. after splitting it On Fri, Jul 9, 2021 at 10:14 PM DJANGO DEVELOPER wrote: > Hi Peter, thanks for your reply. Sorry I have m2m relationship of User > model with Song model and I am using m2m_changes s

get_changeform_initial_data with ManyToMany

2021-07-09 Thread Thibault Thomas
Hello, How can I use admin's get_changeform_initial_data function to prepopulate a many to many relationship widget ? I have the following models in models.py : ___ *class Piece(models.Model):* vehicules = models.ManyToManyField(Vehicule, thr

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread Tree Chip Net
let suppose I have 2 models: *class String(models.model):* *string = models.textarea(null = True, blank = True)* *user = models.ForeignKey(user, on_delete=models.CASCADE)* *def __str__(self):* *return self.string* and *class Song_Words_Count(models.model):* *song = models