How to create a queryset to filter jsonb fields with __ in key name

2019-05-08 Thread Rakesh Ranjan
I have a jsonb field in one of my django model. There are few key value pairs in this json in table with __ in key name. Eg json: ``` data: {'base_cover__tenure': 2, 'base_cover__variant': '125 Z', } ``` How can I create a queryset to filter on these fields? I have tried this

Oracle ORA-03124 Two-task internal error

2019-05-08 Thread Dan Davis
Running my migrations with Django 1.11. (1.11.20), fails with the Oracle error ORA-03124 Two-task internal error. I have tried this with Oracle instantclient 12.1.0.1 and 18.5.0.0., and several other versions of cx_Oracle. There are no migrations to make, but I get the following error, always

How to make the mock object iterable ['TypeError: 'Mock' object is not iterable'] Need to Mock the django query that is iterating through for loop

2019-05-08 Thread Shashank Gupta
I am trying to mock the below django query object : 1.) if MyModel.objects.filter(data='some_data').exists(): then 2.) for row in MyModel.objects.filter(ListId=id): I am trying to test below django query inside my method. def my_method(some_parameter): if

possible bug: test loader fails if models/__init__.py defined

2019-05-08 Thread Matthew Hegarty
Hi I have imported my model classes in models/__init__.py (as described in docs ): You must define or import all models in your application’s models.py or > models/__init__.py. Otherwise, the application

Re: reg: Django model sequense of the fields

2019-05-08 Thread Vinicius Assef
Is it a problem? On Wed, 8 May 2019 at 12:52, 'Amitesh Sahay' via Django users < django-users@googlegroups.com> wrote: > Hello Users, > > I am seeing a very strange issue with my Django models. > in my models.py, I have 21 fields. Out of them , the 6th field is > DASHBoard. However, when I see

reg: Django model sequense of the fields

2019-05-08 Thread 'Amitesh Sahay' via Django users
Hello Users,  I am seeing a very strange issue with my Django models. in my models.py, I have 21 fields. Out of them , the 6th field is DASHBoard. However, when I see those fields in my postgres DB through PgAdminIII, it is listed at the very end of the list.  Sorry, for security reasons I

Re: Need help with project

2019-05-08 Thread Guru Murthy
Try django2 by example by Antonio mele will guide how to do project with django Regards, Gurumurthy P On Wed, 8 May, 2019, 8:32 PM Rob W, wrote: > There are a few of us in a group slack who are trying to build a working > production django ap for reporting. > We are looking for someone who

Need help with project

2019-05-08 Thread Rob W
There are a few of us in a group slack who are trying to build a working production django ap for reporting. We are looking for someone who really knows Django to guide us through this project. We are all really hoping that someone will be kind enough to guide us and help us build this app.

How to Create Program to get current temperature of computer cpu?

2019-05-08 Thread Mayur Bagul
Hello community, i searched on google bout this and what i found was psutil is no longer having check temperature attribute. im not getting how to do this. help me with this ! thanking you, Mayur Bagul. -- You received this message because you are subscribed to the Google Groups "Django

Re: no migrations to apply after deleting a field in models

2019-05-08 Thread Nelson Varela
Don't delete the 0001_initial file! That is your first state. Just delete the field from you model and do makemigrations again.. You wil get a 0002_ file which deletes the field. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Is it possible to create website like Squarespace or Wix in django?

2019-05-08 Thread Zill Facon
I guess that you can create any site like in squarespaceor Wix in any Website builder from Google sites till Mobirise. -- 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

Suscribe

2019-05-08 Thread Ousmane BARRA
Hi, How can i susbcribe in this list? -- 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 post to this group, send

Custom field on admin.py - FieldDoesNotExist when using RelatedFieldWidgetWrapper

2019-05-08 Thread Naran Khetani
Hello Users, Hoping for someone to help me with this, I have a admin form which I am overwriting as below: admin.py def add_related_field_wrapper(form, col_name): rel_model = form.Meta.model rel = rel_model._meta.get_field(col_name).rel form.fields[col_name].widget =

no migrations to apply after deleting a field in models

2019-05-08 Thread amirreza taherkhani
I have this models: class Genre(models.Model): genre = models.CharField(max_length=100) def __str__(self): return self.genre class Book(models.Model): book_name = models.CharField(max_length=150) summary = models.TextField(max_length=1000,

Can't reference related object inside model property

2019-05-08 Thread Ajat Prabha
I have to display a calculated property in the model admin's list_display. ```python class A: # attributes class B: a = models.OneToOneField(A, on_delete=models.CASCADE, related_name='b_obj') timestamp = models.DateTimeField() class AProxy(A): @property def calc_prop(self):

Fresher

2019-05-08 Thread Sanjay Chandak
I am a fresher in Django and know few annotation and using that I have created the dummy application of an application on which I am working in my office. Do I need to go more with the annotations or conditions is fine? I am looking for the job in python. So apart from the Django framework what

Re: Unit conversions between model field value and form field value

2019-05-08 Thread Jani Tiainen
Hi. You could create custom form field that makes conversions both ways. ke 8. toukok. 2019 klo 1.25 Tim Bell kirjoitti: > Hi, > > I have a model with an integer field storing a duration in hours, while I > want to present that to users in a form in days. (The choice of these > different units

Re: Is it Possible to run django locally without internet connection

2019-05-08 Thread Idris Adegbite
Alright, Thanks alot Mr Shashank, Really appreciate, will try it out now On Wed, May 8, 2019 at 3:19 AM Shashank Singh wrote: > Run server with command ./manage.py runserver 0:8000. 0 here tells that > any one on the same network can access the project's urls like this. > Suppose your laptop's

Re: models

2019-05-08 Thread Mohammad Etemaddar
The one who should have foreign key is is filter, box and barel to shelf. Then you can access them from shelf: Shelf0.boxs Shelf0.barels And shelf0.filters Note that you can set the relation_name in foreign key so that you can use the related name instead of filters, boxs and barels On Wed, 8

models

2019-05-08 Thread Robin Riis
if i have a model like class ShelfManager(models.Manager): use_for_related_fields = True def create_cabinet(self, name, number_of_shelfs): cabinet = self.create(name=name, number_of_shelfs=number_of_shelfs) created_shelfs = 0 while created_shelfs < number_of_shelfs: cabinet.shelfs.create()