How to undisplay the field with empty value in django admin?

2018-03-23 Thread shawnmhy
I am currently working on django. I created 4 classes in models.py, one of them is ReactionMeta class. This class has 62 columns, which defined as below: class Reactionsmeta(models.Model): id = models.ForeignKey('Reactions', db_column='id', primary_key=True, max_length=255,

Re: Search by entering to value in JSONField PostgreSQL

2018-03-23 Thread Michael MacIntosh
Hi, Did you try SomeModel.objects.filter(data__name__contains="ar") If you want to union the results from both fields you can use a Q object: https://docs.djangoproject.com/en/2.0/topics/db/queries/#complex-lookups-with-q-objects And that would look something like: complex_query =

Search by entering to value in JSONField PostgreSQL

2018-03-23 Thread Алексей Кузуб
Hi! I work with poorly structured data. I use EAV. But I want to replace EAV with jsonb in postgresql. I need to do a search by entering to value in json.values(). Is it possible? Is there some decision on Django or SQL?For example, there is the model class SomeModel(models.Model): data

Re: Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread 'Alex' via Django users
I've just checked, and self.consistent_hash(group) returns '0' in both functions, so it should be connecting to the same db... On Friday, 23 March 2018 16:05:16 UTC, Andrew Godwin wrote: > > I would check the connection is going to the right server/database as > well? But past that, I can't

Re: Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread 'Alex' via Django users
That did occur to me, but both connect using the function below, so unless they're somehow referring to different groups, I'm not sure how they could be going to different servers/databases... async with self.connection(self.consistent_hash(group)) as connection: On Friday, 23 March 2018

Re: Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread Andrew Godwin
I would check the connection is going to the right server/database as well? But past that, I can't help you - I'd try doing some things with plain aioredis to see if you can replicate it there. Andrew On Fri, Mar 23, 2018 at 9:01 AM, 'Alex' via Django users < django-users@googlegroups.com>

Re: channels and middlewares

2018-03-23 Thread Andrew Godwin
Check your Django version - MIDDLEWARE_CLASSES is deprecated, you should be using the new MIDDLEWARE setting. Andrew On Fri, Mar 23, 2018 at 8:56 AM, Matteo Lucchesi wrote: > It' possible that running a django application with channel2 ingores my > MIDDLEWARE_CLASSES over

Re: Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread 'Alex' via Django users
Hi, I've used the redis-cli to get the contents of the key, and it has filled it properly, so the information is definitely in redis under that key. The issue seems to be that message = await connection.get(pers_key) always returns none. One thing I'm certain of is that it's in redis! Alex

channels and middlewares

2018-03-23 Thread Matteo Lucchesi
It' possible that running a django application with channel2 ingores my MIDDLEWARE_CLASSES over HTTP? -- 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

Re: Personnalisation de champ sur django

2018-03-23 Thread quentin . agren
Bonjour, Je veux creer un model en me servant de la classe Question comme un champ > du model > Je ne sais pas comment m'y prendre > As-tu envisagé de créer un modèle 'Question', et de mettre une clé étrangère de ton modèle vers 'Question' ? Autrement, il faudrait que tu implémentes un champ

Re: Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread Andrew Godwin
It looks correct at first glance - I would insert a debugger there and see what the Redis database contained manually at that point. Andrew On Fri, Mar 23, 2018 at 2:56 AM, 'Alex' via Django users < django-users@googlegroups.com> wrote: > I've been trying to add persistence to channel layers,

Probleme d'access a la base de bonnees dans le terminal window

2018-03-23 Thread ahagbes89
Bonjour J'ai créé un model que j'ai nommé Person.J'ai ensuite fait ensuite les commandes: - python manage.py makemigrations -python manage.py migrate Mais quand je faisfrom .models import Person, ca me génere des erreurs et dit que la table est introuvable Mais quand je vais l'interface

Re: Django and graphs

2018-03-23 Thread Julio Biason
... and although ugly, you can render your data as a javascript object on your template and use any graph rendering library, like jqplot. On Fri, Mar 23, 2018 at 11:04 AM, Derek Zeng wrote: > What do you mean by Django extension? > You can just use the Networkx in any django

Personnalisation de champ sur django

2018-03-23 Thread ahagbes89
Bonjour J'ai créé la classe que voici class Question: def __init__(self,*arg,**kwarg): self.enonce=kwarg['enonce'] self.point=kwarg['point'] self.proposition=arg self.reponse=kwarg['reponse'] Je veux creer un model en me servant de la classe

Re: Django and graphs

2018-03-23 Thread Derek Zeng
What do you mean by Django extension? You can just use the Networkx in any django view controller and render the graph to svg using GraphViz. You can save the svg in database and then render it in a webpage. On Thursday, March 22, 2018 at 3:36:22 PM UTC-4, Mohsen wrote: > > Hi all: > > I am

Using Django Sessions

2018-03-23 Thread Derek Zeng
You can have a flag in cart class to mark if things are cleared. Then in the __iter__ function, check the flag before getting the keys. If you do this you also need to add the check in add/remove and others accordingly. -- You received this message because you are subscribed to the Google

Formset created with inlineformset_factory doesn't render labels on page

2018-03-23 Thread kradem
I've got a formset: I've got a formset: down votefavorite FormSet = inlineformset_factory( User, Profile, fields=('mychoice',), widgets={ 'mychoice':

Annotate with complex queries using Q

2018-03-23 Thread ravi singh
Hello Guys, I am doing complex query using Q objects which is giving me wring 'count' of foreignkey objects that i am calculating using annotation. I can confirm the annotation result is correct when no Q object is being used in the query. Is it an expected behaviour? How can i overcome

django to exe

2018-03-23 Thread Muhammad Faraz
is there any way to convert django webapp tp exe file that will run on localhost -- 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

Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread 'Alex' via Django users
I've been trying to add persistence to channel layers, such that each new consumer joining a group is sent the most recent message from that group, on connect. Below are my attempts. For some reason, the message in the highlighted line always seems to be of type 'None'. Am I going about this