Django Model Image as background image in css

2024-05-11 Thread Paul Magadi
How do we use a model image as a background image for static css -- 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 vi

Re: Getting 4 four latest objects from django model

2023-02-27 Thread Byansi Samuel
Thanks but it returned an error that, 'ActionGame' is not subcriptabe Do you have a way of solving this typerror? On Feb 27, 2023 11:55 AM, "Muhammad Juwaini Abdul Rahman" wrote: > latest_action= [ActionGame.objects.filter (os='windows', > category='action').latest ('published_date')[:4]] > >

Re: Getting 4 four latest objects from django model

2023-02-27 Thread Muhammad Juwaini Abdul Rahman
latest_action= [ActionGame.objects.filter (os='windows', category='action').latest ('published_date')[:4]] On Mon, 27 Feb 2023 at 16:52, Byansi Samuel wrote: > I got a problem with my queryset. Am trying to get 4 latest objects from > my model but it returns 1 objects the top latest. > > Belo

Fwd: Getting 4 four latest objects from django model

2023-02-27 Thread Byansi Samuel
-- Forwarded message -- From: Date: Feb 27, 2023 11:49 AM Subject: Getting 4 four latest objects from django model To: Cc: I got a problem with my queryset. Am trying to get 4 latest objects from my model but it returns 1 objects the top latest. Below is my code. Any support

Getting 4 four latest objects from django model

2023-02-27 Thread Byansi Samuel
I got a problem with my queryset. Am trying to get 4 latest objects from my model but it returns 1 objects the top latest. Below is my code. Any support and guidance is appreciated. #action/views.py from Action.models import ActionGame latest_action= [ActionGame.objects.filter (os='windows',

Re: django model method

2023-02-13 Thread Jason
there's alot to not like about the implementation here. You're effectively hiding queries and db hits with those methods, since the naming does not give any indication that its a db hit. So its really easy to forget that, and then after a while, you're wondering why your project is so slow and

Re: django model method

2023-02-10 Thread Gabriel Araya Garcia
Allways there is a way to improve the code, but if that not run, then try with CYTHON Gabriel Araya Garcia GMI - Desarrollo de Sistemas Informáticos El jue, 9 feb 2023 a las 10:09, Andréas Kühne () escribió: > Not if you want it to be fast. Python itself is slow - so you should try > to offl

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 lib

Re: django model method

2023-02-09 Thread Andréas Kühne
Not if you want it to be fast. Python itself is slow - so you should try to offload most of the computation on the database. So filtering would need to be done on database fields as well. Otherwise you would need to load all of the rows into memory and then do the filtering there. If you want to

Re: django model method

2023-02-09 Thread 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, >

Re: django model method

2023-02-09 Thread Andréas Kühne
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 < allaberdi16yazha...@gmail.com>: > hello guys, Is it possible to use mod

django model method

2023-02-09 Thread 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", re

Re: Django model design best practice guidance

2022-12-08 Thread Joshua Corlin
Thanks Mike, i think the lack of understanding of the underlying implementation is what was tripping me up. Data tracked by this "field" actually being a different table at the DB level makes complete sense. I have added the M2M field to my ticket model and now have this working at the DB lev

Re: Django model design best practice guidance

2022-12-08 Thread Mike Dewhirst
On 9/12/2022 3:04 am, Joshua Corlin wrote: Ive not used this field before so if it is im having a hard time wrapping my head around how this would work in this use case. Many-to-many is simple to conceptualise if you realise it is not a field in the table you think it is. It is actually a se

Django model design best practice guidance

2022-12-08 Thread Joshua Corlin
Hello Django Community, I am working on implementing a feature in a project that I built and I am looking for some guidance on how implement the database side of this feature most efficiently. The models in question: The two models in question are the user model and a model that tracks tick

Re: Django Model related_name

2022-09-08 Thread Toshar Saini
when you want to fetch multiple objects from reverse relation(foriengkey) On Tue, Sep 6, 2022 at 3:51 PM Justin Kpakpa wrote: > Hello, pls under what circumstances do you need to defined a related_name > of a model field? > > -- > You received this message because you are subscribed to the Googl

Django model field different from db field managed=false

2022-09-06 Thread ISMAIL TAIBANI
I have model containing field ad_account_id = models.TextField(null=True, blank=True) but this model is managed = False and in database type is int and not textfield whenever i do query using ORM it gives ad_account_id type as int and not str and don't through any exception as well why is it so

Re: Django Model related_name

2022-09-06 Thread DJANGO DEVELOPER
when you want to fetch multiple objects from that model ( having a foreign key relation) On Tue, Sep 6, 2022 at 3:21 PM Justin Kpakpa wrote: > Hello, pls under what circumstances do you need to defined a related_name > of a model field? > > -- > You received this message because you are subscrib

Django Model related_name

2022-09-06 Thread Justin Kpakpa
Hello, pls under what circumstances do you need to defined a related_name of a model field? -- 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+unsubsc

Re: List Field in Django Model while using SQLite

2022-06-17 Thread Muhammad Juwaini Abdul Rahman
Did you read the forum thread? On Fri, 17 Jun 2022 at 20:21, Mukul Verma wrote: > Thanks but it would not work for me if you have any example code please > share i need to use that > > > On Friday, 17 June 2022 at 14:30:00 UTC+5:30 juw...@gmail.com wrote: > >> This could be helpful: >> https://f

Re: List Field in Django Model while using SQLite

2022-06-17 Thread Mukul Verma
Thanks but it would not work for me if you have any example code please share i need to use that On Friday, 17 June 2022 at 14:30:00 UTC+5:30 juw...@gmail.com wrote: > This could be helpful: > https://forum.djangoproject.com/t/use-an-array-of-fields-with-sqlite/2320 > > On Fri, 17 Jun 2022 at

Re: List Field in Django Model while using SQLite

2022-06-17 Thread Muhammad Juwaini Abdul Rahman
This could be helpful: https://forum.djangoproject.com/t/use-an-array-of-fields-with-sqlite/2320 On Fri, 17 Jun 2022 at 15:00, Mukul Verma wrote: > Hii Everyone, > Thanks for all the advice and suggestions. > currently i got stuck with a problem i have to store list of some data in > a specific

List Field in Django Model while using SQLite

2022-06-17 Thread Mukul Verma
Hii Everyone, Thanks for all the advice and suggestions. currently i got stuck with a problem i have to store list of some data in a specific field of the model may you please suggest me or if possible share code snippet. How can i store the list in the model field while using SQLite please. --

Re: On django model.

2021-12-26 Thread Gabriel Araya Garcia
Zamora () escribió: > Hi guys. > I have an application in Django that has a database in postgresql. > But a new table was added to that database. > I have tried using the inspectdb (python3 manage.py inspectdb > tracking_visit) command, to add that table to the DJango model, but i

Re: On django model.

2021-12-24 Thread Bernard Mallala
;> >>> Hi guys. >>> I have an application in Django that has a database in postgresql. >>> But a new table was added to that database. >>> I have tried using the inspectdb (python3 manage.py inspectdb >>> tracking_visit) command, to add that tabl

Re: On django model.

2021-12-24 Thread Amor Zamora
I have an application in Django that has a database in postgresql. >> But a new table was added to that database. >> I have tried using the inspectdb (python3 manage.py inspectdb >> tracking_visit) command, to add that table to the DJango model, but it >> gives me an exception, it t

Re: On django model.

2021-12-24 Thread Bernard Mallala
You can achieve this in two ways: 1. python manage.py inspectdb --help Introspects the database tables in the given database and outputs a Django model module. Your id field should be a sequenced integer and primary key so must include these two lines if viewing the CREATE SQL

Re: On django model.

2021-12-24 Thread Rafael Matos Borges
n3 manage.py inspectdb >> tracking_visit) command, to add that table to the DJango model, but it >> gives me an exception, it tells me that the ID field of the new table is >> not an integer and if it is, I put it as an integer and primary key and so >> on itself is reflected

Re: On django model.

2021-12-24 Thread Muhammad Juwaini Abdul Rahman
abase in postgresql. >>> But a new table was added to that database. >>> I have tried using the inspectdb (python3 manage.py inspectdb >>> tracking_visit) command, to add that table to the DJango model, but it >>> gives me an exception, it tells me that the ID fi

Re: On django model.

2021-12-24 Thread Sebastian Jung
rial.djangogirls.org/de/ >> >> Regards >> >> Amor Zamora schrieb am Fr., 24. Dez. 2021, 13:11: >> >>> Hi guys. >>> I have an application in Django that has a database in postgresql. >>> But a new table was added to that database. >>

Re: On django model.

2021-12-24 Thread Amor Zamora
chrieb am Fr., 24. Dez. 2021, 13:11: > >> Hi guys. >> I have an application in Django that has a database in postgresql. >> But a new table was added to that database. >> I have tried using the inspectdb (python3 manage.py inspectdb >> tracking_visit) command, to add that

Re: On django model.

2021-12-24 Thread Muhammad Juwaini Abdul Rahman
. >> I have tried using the inspectdb (python3 manage.py inspectdb >> tracking_visit) command, to add that table to the DJango model, but it >> gives me an exception, it tells me that the ID field of the new table is >> not an integer and if it is, I put it as an integer and

Re: On django model.

2021-12-24 Thread Sebastian Jung
ave an application in Django that has a database in postgresql. > But a new table was added to that database. > I have tried using the inspectdb (python3 manage.py inspectdb > tracking_visit) command, to add that table to the DJango model, but it > gives me an exception, it tells me that the I

On django model.

2021-12-24 Thread Amor Zamora
Hi guys. I have an application in Django that has a database in postgresql. But a new table was added to that database. I have tried using the inspectdb (python3 manage.py inspectdb tracking_visit) command, to add that table to the DJango model, but it gives me an exception, it tells me that the

Re: Declarative mechanism for Django model rows

2021-12-09 Thread Carsten Fuchs
Hello, Am 08.12.21 um 20:25 schrieb Alex Dehnert: > With some frequency, I end up with models who contents are approximately > constant. Are there good ways of handling this? If I understand your question correctly, you have a model that you always query like: plans = Plan.objects.all(

Re: Declarative mechanism for Django model rows

2021-12-09 Thread Ryan Nowakowski
sumably depends on how much ORM >functionality I actually want and how often I expect to be changing >things. > >Are there other good approaches for this? Am I missing some Django feature >(or add-on) that makes this easier? > >Thanks, >Alex > >P.S. I previously a

Re: Declarative mechanism for Django model rows

2021-12-08 Thread Thomas Lockhart
is better presumably depends on how much ORM > functionality I actually want and how often I expect to be changing things. > > Are there other good approaches for this? Am I missing some Django feature > (or add-on) that makes this easier? > > Thanks, > Alex >

Declarative mechanism for Django model rows

2021-12-08 Thread Alex Dehnert
erflow at https://stackoverflow.com/questions/70204467/declarative-mechanism-for-django-model-rows, but I'm realising this list is probably better. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Encrypt A Table using Django Model

2021-08-13 Thread 'Peter van der Does' via Django users
https://django-cryptography.readthedocs.io/en/latest/ On 8/12/21 3:49 AM, Sachin Kumar wrote: > Hi Experts, > > If anyone has done encryption of table using Django. please let us > know the process or any article which helps in the encryption of table > data using Model and when required it decryp

Renaming Django model without breaking existing migrations

2021-08-12 Thread Alan Evangelista
I want to rename a model in Django 3.2, keep my existing migrations and be able to both migrate a db with the old table name and create a db from scratch. I've started by renaming the model class and all references to it in the code. As "./manage.py makemigrations" did not automatically create a m

Encrypt A Table using Django Model

2021-08-12 Thread Sachin Kumar
Hi Experts, If anyone has done encryption of table using Django. please let us know the process or any article which helps in the encryption of table data using Model and when required it decrypt the table data. Please help and Guide for a Solution. Regards Sachin -- You received this messag

An app that provides Django model comment migration

2021-08-10 Thread 'starryrbs' via Django users
Feature - Automatic migration model help_text to comment [Support customization] - Automatically migrate the verbose_name of the model to the table comment [Support customization] - Provide a command to migrate the comment of the specified app Github repo

Re: override save() twice in django model!

2021-05-01 Thread RITIK SONI
verride save() method of a django model twice? >> >> -- >> 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-u

Re: override save() twice in django model!

2021-05-01 Thread Kunal Solanke
I don't think so, why not do in one function or you can use pre save and pist save signals On Sat, May 1, 2021, 19:11 RITIK SONI wrote: > am i able to override save() method of a django model twice? > > -- > You received this message because you are subscribed to the Google

override save() twice in django model!

2021-05-01 Thread RITIK SONI
am i able to override save() method of a django model twice? -- 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.co

How to give select images option in django model forms ?

2021-03-14 Thread Kumar Gaurav
Hii Everyone, I have a Model Form, one field is to upload image. Right now , user can select images from their system and upload but I want to give a certain number of images as a dropdown option (showing the images in preview) to select from. How can I implement this ?? and the best solution

Re: How to set daily update limit for django model(db)?

2021-02-13 Thread Chetan Ganji
Hi Shailesh, I am assuming you have created_at and updated_at fields (these or similar) on the model. You can write a query like below to get the count of no of rows updated that day using below code. Remember to update the filters of the queryset as required e.g. user. from django.utils import

Re: How to set daily update limit for django model(db)?

2021-02-04 Thread Shailesh Yadav
Hi Jaimikp, I have checked it but no luck. Can we make changes in the resource.py file? check the count and store that count into a variable and the next day the count value should get reset. I have checked *before_import *but not able to implement and also don't know if implementing this at res

Re: How to set daily update limit for django model(db)?

2021-01-25 Thread Jaimik Patel
Hi Shailesh, you can define the function with the use of DateTime module, which changes the value of the variable daily for the count. https://stackoverflow.com/questions/52305294/changing-a-variable-based-on-current-time-of-day and for excel, you can get the number of lines in the file, and you

Re: How to set daily update limit for django model(db)?

2021-01-22 Thread Gabriel Araya Garcia
Hi Sahilesh: Try with this: https://www.kite.com/python/answers/how-to-count-the-number-of-rows-in-a-pandas-dataframe-in-python El viernes, 22 de enero de 2021 a las 14:39:35 UTC-3, shailesh...@gmail.com escribió: > Thanks! but Can you elaborate more? > *howmany = mytable.count()* = Here How it

Re: How to set daily update limit for django model(db)?

2021-01-22 Thread Shailesh Yadav
Thanks! but Can you elaborate more? *howmany = mytable.count()* = Here How it'll work and how to reset the value in 1 day. how I can use it in my code. import xlrd = I was trying something like this def CTA_upload(request): i = 1 count = (1,) print('Counter value at starting :', len(count))

Re: How to set daily update limit for django model(db)?

2021-01-22 Thread Gabriel Araya Garcia
Previous, you can use: howmany = mytable.count() Also you can use xlrd library, for instance: import xlrd #open excel file documento = xlrd.open_workbook("ejemplo.xls") #We can save each one of the spreadsheet separately libros = documento.sheet_by_index(0) peliculas = documento.sheet_by_index(1

How to set daily update limit for django model(db)?

2021-01-22 Thread Shailesh Yadav
Hi I'm having one Django web app where My *model A *contains 1000 records and I want to set a daily update limit for example if users are updating that data by uploading a .xls file then it should count how many records updated and once it is more than 500 then the user should get an Error mess

How to set daily Update limit on Django model

2021-01-04 Thread Shailesh Yadav
<https://stackoverflow.com/posts/65565954/timeline> I'm new to Django. I have created one Django App where users can update their Shift Timing(Morning/Evening/General) and based on this Shift Timing I am taking real-time data from Django Model and running Linux script which will be

how to override options of choices in django model form

2020-07-28 Thread Sujata Aghor
Hello All, How can I override options of choices in django model form from the model field ? Below is my code - *models.py:* class XXX(models.Model): StatusType = models.TextChoices('StatusType', const.status_values) status = models.CharField(max_length=100, default=

Re: How to get data from django model to excel sheet using openpyxl including images.

2020-07-10 Thread VenkataSivaRamiReddy
; >> >> >> *From: *Ashutosh Mishra >> *Sent: *10 July 2020 18:30 >> *To: *Django users >> *Subject: *Re: How to get data from django model to excel sheet using >> openpyxl including images. >> >> >> >> i have created an api through

Re: How to get data from django model to excel sheet using openpyxl including images.

2020-07-10 Thread Ashutosh Mishra
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for > Windows 10 > > > > *From: *Ashutosh Mishra > *Sent: *10 July 2020 18:30 > *To: *Django users > *Subject: *Re: How to get data from django model to excel sheet using > openpyxl including ima

RE: How to get data from django model to excel sheet using openpyxl including images.

2020-07-10 Thread Vishesh Mangla
Api’s are better suited for Django rest framework. Sent from Mail for Windows 10 From: Ashutosh MishraSent: 10 July 2020 18:30To: Django usersSubject: Re: How to get data from django model to excel sheet using openpyxl including images. i have created an api through which i can download the excel

Re: How to get data from django model to excel sheet using openpyxl including images.

2020-07-10 Thread Ashutosh Mishra
response except Exception as error: traceback.print_exc() return Response({"message": str(error), "success": False}, status=status.HTTP_200_OK) On Friday, July 10, 2020 at 5:48:36 PM UTC+5:30 ajoeiam wrote: > On Thu, Jul 9, 2020 at 10:02 PM Ashutosh Mishra > wrote:

Re: How to get data from django model to excel sheet using openpyxl including images.

2020-07-10 Thread o1bigtenor
On Thu, Jul 9, 2020 at 10:02 PM Ashutosh Mishra wrote: > I am creating an api to get data and images from django model to excel > sheet ,how can i do that,someone please help me. > > > What have you tried so far? Regards -- You received this message because you are subscribe

How to get data from django model to excel sheet using openpyxl including images.

2020-07-09 Thread Ashutosh Mishra
I am creating an api to get data and images from django model to excel sheet ,how can i do that,someone please help me. -- 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 i

RE: How to get data from django model to the excel sheet.

2020-07-06 Thread Vishesh Mangla
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_sql.html Sent from Mail for Windows 10 From: Ashutosh MishraSent: 06 July 2020 13:56To: django-users@googlegroups.comSubject: Re: How to get data from django model to the excel sheet. But It is for js,react,angular, how can I

Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Luciano Martins
To work with excell within Django projects we use the *openxl *library, but you can't use it directly, you need to build scripts that bring you what you want. Em segunda-feira, 6 de julho de 2020 03:59:29 UTC-3, Ashutosh Mishra escreveu: > > I want to get the data from the d

RE: How to get data from django model to the excel sheet.

2020-07-06 Thread Vishesh Mangla
 From: sum abiutSent: 06 July 2020 13:29To: django-users@googlegroups.comSubject: Re: How to get data from django model to the excel sheet. You can try this export data to excel fileSum, On Mon, Jul 6, 2020 at 7:00 PM Ashutosh Mishra <ashutoshmishra...@gmail.com> wrote:I want to get the dat

Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Ashutosh Mishra
But It is for js,react,angular, how can I place that in django project On Jul 6, 2020 1:54 PM, "Damanjeet Singh" wrote: > Please see handsontable.com. > > I have been using it for my project. > > On Mon, Jul 6, 2020 at 9:06 AM Ashutosh Mishra < > ashutoshmishra...@gmail.com> wrote: > >> What if I

Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Damanjeet Singh
Please see handsontable.com. I have been using it for my project. On Mon, Jul 6, 2020 at 9:06 AM Ashutosh Mishra wrote: > What if I have an image field too,how to do that > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe

Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Ashutosh Mishra
What if I have an image field too,how to do that -- 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 discussi

Re: How to get data from django model to the excel sheet.

2020-07-06 Thread mohamed khaled
You can serialized your data and then use any tools to export the data as csv for example. On Mon, Jul 6, 2020, 9:00 AM Ashutosh Mishra wrote: > I want to get the data from the django model contans(name,age,photo) on a > excel sheet. > How can i do that. > > -- > You rec

Re: How to get data from django model to the excel sheet.

2020-07-06 Thread sum abiut
You can try this export data to excel file <https://simpleisbetterthancomplex.com/tutorial/2016/07/29/how-to-export-to-excel.html> Sum, On Mon, Jul 6, 2020 at 7:00 PM Ashutosh Mishra wrote: > I want to get the data from the django model contans(name,age,photo) on a > excel sheet. &g

How to get data from django model to the excel sheet.

2020-07-05 Thread Ashutosh Mishra
I want to get the data from the django model contans(name,age,photo) on a excel sheet. How can i do that. -- 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

Unable to export images from django model to excel sheet

2020-07-04 Thread Ashutosh Mishra
I have posted on stack overflow.I want export images from django model to excel sheet.while doing I am just getting the root media address on excel sheet not image. Please help ,it's urgent. https://stackoverflow.com/questions/62695531/unable-to-export-images-from-django-model-to-excel-

Re: Django Model

2020-05-14 Thread muazzem_ hossain
Thank you for help On Thu, May 14, 2020 at 7:23 PM Derek wrote: > >>> from django.apps import apps > >>> apps.all_models['app_name'] > > So if your app is called, for example, products, then: > > >>> apps.all_models['products'] > > Will create a dictionary with all the model classes from that ap

Re: Django Model

2020-05-14 Thread Derek
>>> from django.apps import apps >>> apps.all_models['app_name'] So if your app is called, for example, products, then: >>> apps.all_models['products'] Will create a dictionary with all the model classes from that app. On Thursday, 14 May 2020 14:03:40 UTC+2, muazzem_ hossain wrote: > > how to

Django Model

2020-05-14 Thread muazzem_ hossain
how to get django all app model. -- 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 vi

How to sort a column by Django model method using django-sortable-listview (SortableListView)?

2020-04-20 Thread Nancy Jenifer Benita S
Using *django-sortable-listview* package, I'm using *SortableListView *to sort out all the model fields. In my case, more than model fields, I want to sort it out by model method too. Models.py class Employee(models.Model): name = models.CharField() designation = models.CharField

Re: using two foreign keys in one django model

2020-03-10 Thread hunar techie
https://stackoverflow.com/questions/60596945/how-to-create-post-with-different-user-type-two-foreign-key-for-one-post-model here you go On Mon, Mar 9, 2020 at 5:09 PM Ryan Nowakowski wrote: > > > On March 9, 2020 5:13:40 AM CDT, namo wrote: > >i'm working on a project the scenario : teacher mo

Re: using two foreign keys in one django model

2020-03-09 Thread Ryan Nowakowski
On March 9, 2020 5:13:40 AM CDT, namo wrote: >i'm working on a project the scenario : teacher model can upload >courses , >then if the teacher has not a profile the institute(model) which >working at >will upload the courses does this is write way i have tried in the >course > model? When yo

using two foreign keys in one django model

2020-03-09 Thread namo
i'm working on a project the scenario : teacher model can upload courses , then if the teacher has not a profile the institute(model) which working at will upload the courses does this is write way i have tried in the course model? class Course(models.Model): course_name = models.CharField(

Re: Manually running a script that imports a Django model

2020-02-13 Thread maninder singh Kumar
Could it be an improperly configured database ? Also check installed apps. It is most likely a syntax error in settings like a comma, colon or apostrophe Sent from my iPad > On 13-Feb-2020, at 7:34 PM, onlinejudge95 wrote: > >> On Thu, Feb 13, 2020 at 6:34 PM Sourish Kundu >> wrote: > >> S

Re: Manually running a script that imports a Django model

2020-02-13 Thread onlinejudge95
On Thu, Feb 13, 2020 at 6:34 PM Sourish Kundu wrote: > So I am trying to access one of my models created in views.py in another > script. This second script is the one I would like manually run. It imports > the model without any errors; however, when I try to run it using PyCharm, > I get this e

Re: Manually running a script that imports a Django model

2020-02-13 Thread Adam Mičuda
Hi, the solution is written in the error message "You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure()...". But I would recommend you to use https://django-extensions.readthedocs.io/en/latest/runscript.html. I think it is what you are want. ;) Regards

Manually running a script that imports a Django model

2020-02-13 Thread Sourish Kundu
So I am trying to access one of my models created in views.py in another script. This second script is the one I would like manually run. It imports the model without any errors; however, when I try to run it using PyCharm, I get this error: *django.core.exceptions.ImproperlyConfigured: Request

Re: Need to Query complex django model

2019-12-11 Thread Kasper Laudrup
Hi Nitin, On 11/12/2019 08.04, Nitin Kalmaste wrote: Hello community, I need to make django views for the models described below. How do i create query to write in view https://stackoverflow.com/questions/59280345/how-to-query-django-models-for-complex-models-like-this You are approaching th

Need to Query complex django model

2019-12-10 Thread Nitin Kalmaste
Hello community, I need to make django views for the models described below. How do i create query to write in view https://stackoverflow.com/questions/59280345/how-to-query-django-models-for-complex-models-like-this Please Need Help seriously -- You received this message because you are subscr

Re: reg: django Model for MCQs type project

2019-11-21 Thread 'Amitesh Sahay' via Django users
Hi Yoo, Thank you for your detailed reply. while I was waiting for some response. I did some research and I came up with some model as below. Please go through it and suggest the changes. from django.db import models from django.contrib.auth.models import User from django.template.defaultfilter

Re: reg: django Model for MCQs type project

2019-11-20 Thread Yoo
Have a Test model which as a unique identifier (BigAutoField). Get a Questions model with a foreign key to a test and a charfield for the question itself (you can add BrinIndex for optimization). You can add a booleanfield if the question is optional and whatever else you need (like the correct

reg: django Model for MCQs type project

2019-11-19 Thread 'Amitesh Sahay' via Django users
Hello Members, I have below requirements for a project where I need to develop the model based on "multiple Choice Questions". Below are the criteria:- - Admin can create/edit/delete(soft delete only) a "Test" in the form of MCQs. - Admin can then create/edit/delete a "Question" to each

Re: search results from a Django model method including the results from earlier calls to the same method (x post StackOverflow)

2019-10-28 Thread yolabingo
Solved on SO, but an extremely educational response. I learned about mutable default argument gotcha https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument And Django Modified Preorder Tree Traversal https://github.com/django-mptt/django-mptt -- You

search results from a Django model method including the results from earlier calls to the same method (x post StackOverflow)

2019-10-28 Thread yolabingo
I also posted this to SO https://stackoverflow.com/questions/58600159/search-results-from-a-django-model-method-including-the-results-from-earlier-cal hope that's ok, let me know if not. I have a Django Model that tracks email message IDs as the message passes through different servers. I

How to save an array of text in PostgreSQL using Django model.?

2019-08-19 Thread Shafay Haseeb
I have asked this question on StackOverflow here, https://stackoverflow.com/questions/57547588/how-to-save-an-array-of-text-in-postgresql-using-django-model but havent received any input. My question is simple, how to store a list in django postgresql model. You could refer to my link above

Django Model form not saving items to database

2019-07-01 Thread brian
Model class Products(models.Model): UNIT = ( ('whole', 'whole unit'), ('item', 'per single item'), ) # category = models.ForeignKey(Category, related_name='products', on_delete=models.CASCADE) ProductName = models.CharField(max_length=255) user = models.Fore

Re: Django model form is not getting saved in Postgresql database

2019-06-03 Thread Taylor Hughes-Scott
No problem. Glad you got it sorted. On Tue., 4 Jun. 2019, 8:16 am Ankhi Roy, wrote: > Hey, > > Nevermind I have solved the problem. > I was in an impression that I need to create a seperate database > equivalent to django model form. Then realised that Django automatically >

Re: Django model form is not getting saved in Postgresql database

2019-06-03 Thread Taylor Hughes-Scott
With your form.save() call try passing commit=True so it looks like form.save(commit=True) On Tue., 4 Jun. 2019, 1:39 am Ankhi Roy, wrote: > Hi, > > I am using Django admin - 2.2.1 and Postgresql as my database. So my > problem is I have saved the user entered data in form.py on "POST" Request >

Re: Django model form is not getting saved in Postgresql database

2019-06-03 Thread Ankhi Roy
Hey, Nevermind I have solved the problem. I was in an impression that I need to create a seperate database equivalent to django model form. Then realised that Django automatically creates a database table like databasename_modelclassname and have all the columns as per Django model form. Anyway

Django model form is not getting saved in Postgresql database

2019-06-03 Thread Ankhi Roy
Hi, I am using Django admin - 2.2.1 and Postgresql as my database. So my problem is I have saved the user entered data in form.py on "POST" Request but it isn't saving in the postgresql database. Model.py - class modelForm(models.Model): CHOICES = [('Y', 'Yes'), ('N', 'No'

Re: reg: Django model sequense of the fields

2019-05-18 Thread 'Akash Sinha' via Django users
Position doesn't matters. On Fri, May 17, 2019 at 7:12 PM, Test Bot wrote: [Just Curious] would it matter in any way what the position of field is in the respective tables. On Fri, May 17, 2019, 5:46 PM 'Akash Sinha' via Django users wrote: Hello  This happens for 2 reasons 1st. Those

Re: reg: Django model sequense of the fields

2019-05-17 Thread Test Bot
[Just Curious] would it matter in any way what the position of field is in the respective tables. On Fri, May 17, 2019, 5:46 PM 'Akash Sinha' via Django users < django-users@googlegroups.com> wrote: > Hello > > This happens for 2 reasons > > 1st. Those fields might be Foreign key, Foreign key fie

Re: reg: Django model sequense of the fields

2019-05-17 Thread 'Akash Sinha' via Django users
Hello  This happens for 2 reasons 1st. Those fields might be Foreign key, Foreign key fields are shown at the end in DB. 2nd.  You have added those fields later in our model class, if you will add new fields in model.py file those fields will be listed at the end. On Wed, May 8, 2019 at

Re: Django Model Forms.

2019-05-17 Thread Alex Kimeu
data {{ form.password }} > > On Friday, May 17, 2019 at 2:23:14 AM UTC-5, kimeualexis wrote: >> >> Hello, guys. >> Is there a way to lay out Django Model form fields across the Browser >> rather than top-down? >> >> Kindly assist. >> > -- >

Re: Django Model Forms.

2019-05-17 Thread Joe Reitman
a way to lay out Django Model form fields across the Browser > rather than top-down? > > Kindly assist. > -- 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,

  1   2   3   4   5   6   >