Re: Finding the last modified timestamp for a group of Models

2024-02-28 Thread Jason
https://docs.djangoproject.com/en/5.0/ref/applications/#django.apps.AppConfig.get_models gets you an iterable of all models loaded On Tuesday, February 27, 2024 at 8:53:32 AM UTC-5 Alex Guetsche wrote: > I have an application which contains more than one Model, all descended > from an ab

Finding the last modified timestamp for a group of Models

2024-02-27 Thread Alex Guetsche
I have an application which contains more than one Model, all descended from an abstract one. All the operational Models have created and modified fields with datetime timestamps. [How] can I get the Django ORM to bring me the last modified timestamp that will be the maximum of all createds

Re: Custom User models

2023-11-28 Thread Okkert Joubert
; from django.contrib.auth.models import AbstractUser > from django.db import models > > class School(models.Model): > # Your School model fields > > class SchoolUser(AbstractUser): > school = models.ForeignKey(School, on_delete=models.CASCADE) > # Add

Re: Custom User models

2023-11-27 Thread Ahmed Iftikhar
# models.py from django.contrib.auth.models import AbstractUser from django.db import models class School(models.Model): # Your School model fields class SchoolUser(AbstractUser): school = models.ForeignKey(School, on_delete=models.CASCADE) # Add other custom fields as needed

Re: Custom User models

2023-11-27 Thread Clive Bruton
I am taking it that there is more than one "school"? If so, surely it's is just a many-to-many relationship. On 27 Nov 2023, at 09:33, Okkert Joubert wrote: Good morning all, I made a custom user model for a school, it is currently working with djoser authentication, now what I want to

Custom User models

2023-11-27 Thread Okkert Joubert
Good morning all, I made a custom user model for a school, it is currently working with djoser authentication, now what I want to add is for the school to add users, so my School model is a foreignkey in SchoolUser is this possible firstly and secondly can I add the djoser authentication to

Dynamic models

2023-05-22 Thread ruth salvatore
Here I am creating django dynamic models but for getting data i am using get method but i am not getting data it just says that table does not exist even if it is present. from django.http import JsonResponse from.serializers import CreateTableSerializer from django.db import connection

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-03-02 Thread Boris Pérez
One way could be latest_action=ActionGame.obje cts.filter(published=published).order_by('-id')[:1] El jue, 2 mar 2023 a las 17:29, Sandip Bhattacharya (< sand...@showmethesource.org>) escribió: > Your problem is still about where the 'published’ value is coming from in > the call to

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-03-02 Thread Sandip Bhattacharya
Your problem is still about where the 'published’ value is coming from in the call to filter(published=published). Is it coming from a form? A Get parameter? A post parameter? Extract it appropriately before calling filter() > On Mar 2, 2023, at 3:46 AM, Byansi Samuel wrote: > > def action

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-03-02 Thread Byansi Samuel
Hey thanks, but l tried to use ordering=('-published') On Feb 28, 2023 5:04 PM, "Dev Femi Badmus" wrote: all_action=ActionGame.objects.all() my_action = [] for action in all_action: my_action.append(action) last_action = my_action[-1] On Tue, Feb 28, 2023 at 1:05 PM Andréas Kühne wrote:

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-02-28 Thread Andréas Kühne
I'm sorry Dev, but that is really bad practice. You are doing in python what can be done by the database. That type of code would create a memory error and be very slow to run. It's much better to get the last item from the database. In your example it would just be: last_action =

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-02-28 Thread Dev Femi Badmus
all_action=ActionGame.objects.all() my_action = [] for action in all_action: my_action.append(action) last_action = my_action[-1] On Tue, Feb 28, 2023 at 1:05 PM Andréas Kühne wrote: > Se comments below. > > > Den fre 24 feb. 2023 kl 12:14 skrev Byansi Samuel < > samuelbyans...@gmail.com>:

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-02-28 Thread Andréas Kühne
Se comments below. Den fre 24 feb. 2023 kl 12:14 skrev Byansi Samuel : > Hey everyone, l got a problem. Am trying to retrieve a single latest > object added everytime, and display it in the template. > Below is my codes but; > > Help me figure it out the source of the problem in these different

How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-02-24 Thread Byansi Samuel
Hey everyone, l got a problem. Am trying to retrieve a single latest object added everytime, and display it in the template. Below is my codes but; Help me figure it out the source of the problem in these different instances below  ___ issue number 1___

Casesentives in models in django

2023-01-22 Thread Hi ND
I tried to put this code to deactivate the sensitivity of the characters when logging in, but it does not work. What is the problem with it? It still appears to me. Please consider the sensitivity of the characters I want to use this method. I do not want to use the backend method Please

How to set uploaded imagefield image size both in forms or models

2022-12-15 Thread Raeesh 23
How to set uploaded imagefield image size both in forms or models -- 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...@google

Re: HOW TO GET DJANGO MODELS FIELD VALUE FROM MODEL OBJECT IN TEMPLATE TAGS-DJANGO

2022-11-07 Thread James
Hi; There's a method you're supposed to override in your views (inherit from Views) to do what you want, it's called "get_context_data". This method will pump whatever data you send to it into your template tags. On Sunday, November 6, 2022 at 4:15:35 AM UTC-7 rani...@gmail.com wrote: > my

Re: HOW TO GET DJANGO MODELS FIELD VALUE FROM MODEL OBJECT IN TEMPLATE TAGS-DJANGO

2022-11-06 Thread Kala Rani
I want to get region_name field values in my template.its .giving null value On Sunday, November 6, 2022 at 8:31:42 PM UTC+5:30 sebasti...@gmail.com wrote: > Pls write us your aim with this code... > > Kala Rani schrieb am So., 6. Nov. 2022, 12:15: > >> my models.py >> >> class

Re: HOW TO GET DJANGO MODELS FIELD VALUE FROM MODEL OBJECT IN TEMPLATE TAGS-DJANGO

2022-11-06 Thread Sebastian Jung
Pls write us your aim with this code... Kala Rani schrieb am So., 6. Nov. 2022, 12:15: > my models.py > > class Locations(models.Model): > region = models.ForeignKey(Regions, > on_delete=models.CASCADE,blank=True,null=True) > name = models.CharField(max_length=255) > active_flag =

HOW TO GET DJANGO MODELS FIELD VALUE FROM MODEL OBJECT IN TEMPLATE TAGS-DJANGO

2022-11-06 Thread Kala Rani
my models.py class Locations(models.Model): region = models.ForeignKey(Regions, on_delete=models.CASCADE,blank=True,null=True) name = models.CharField(max_length=255) active_flag = models.BooleanField(default=True) created_at = models.DateTimeField(auto_now_add = True) updated_at =

Proxy Models in ForeignKey field

2022-10-14 Thread Ayush Bisht
Hey everyone, I need a help, regarding use of proxy models at foreignKey field. class User(AbstractUser): is_customer = models.BooleanField(default=False) ... class Customer(User): objects = CustomerManger() # get_queryset will filtered out all the models based

Re: Adding csv as models

2022-09-23 Thread Sajanraj T D
You can use js datatable to render csv or what ever you want in the table format. You can also upload data as csv in file upload in model form. If you want to render csv, then it should transform to json format and pass via jsonresponse. Or httepresponse using mimetype. On Fri, 23 Sep, 2022, 7:20

Re: Adding csv as models

2022-09-23 Thread Thomas Lockhart
do a file upload, then have separate code which reads the file into models. Separating these things helps with managing “sets” of data and catching malformed files. For fancy plots I use Bokeh which, if you don’t need realtime updates, can be run from within Django. For models, you should

Adding csv as models

2022-09-23 Thread Preethy P Johny
Hello All, I am new to Django and currently in the mid of a project. I am creating a dashboard for a hospital and the data is in the form of a csv/xls. I have rendered the the interactive graphs which I need to display on the dashboard, however on the jupyter notebook. How can I integrate it

Customise Django Models

2022-09-11 Thread Jishnu C K
Hi, Some blogs I have written, hope someone find it useful :) https://jishnuck.medium.com/customizing-django-models-to-facilitate-user-restricted-data-768fe8206f82 <https://jishnuck.medium.com/customizing-django-models-to-facilitate-user-restricted-data-768fe8206f82> Jishnu C K j

Re: How to use same Models for all apps?

2022-08-29 Thread Javier L. Camacaro
with the new version of django > by adding apps and import modules. > > On Sat, 27 Aug 2022, 23:55 Lakshyaraj Dash, > wrote: > >> Ya sure you can use the same models throughout your project. If you're i >> a different app then import statement will be like >>

Re: How to use same Models for all apps?

2022-08-27 Thread Samuel Alie Mansaray
Am new in django framework, am get problem with the new version of django by adding apps and import modules. On Sat, 27 Aug 2022, 23:55 Lakshyaraj Dash, wrote: > Ya sure you can use the same models throughout your project. If you're i a > different app then import statement will be like

Re: How to use same Models for all apps?

2022-08-27 Thread Lakshyaraj Dash
Ya sure you can use the same models throughout your project. If you're i a different app then import statement will be like from appName.models import tableName else if you're in the same app from .models import tableName Thanks and Regards Lakshyaraj Dash On Sun, Aug 28, 2022, 04:48 Javier L

Re: How to use same Models for all apps?

2022-08-27 Thread Ryan Nowakowski
You can use a model from one app in other apps. Simply import it in the apps where you need it. On August 27, 2022 5:43:40 PM CDT, "Javier L. Camacaro" wrote: >Do i need to repeat the models for each app?, Can I use same model for all >the apps in my project? > &g

How to use same Models for all apps?

2022-08-27 Thread Javier L. Camacaro
Do i need to repeat the models for each app?, Can I use same model for all the apps in my project? I'm a new a DJango programmer, sorry for that Thanks! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

How to use the MigrationAutodetector manually for dynamic models

2022-08-08 Thread Diederik van der Boor
Hi All, I'm working on an API-server project that uses dynamically generated Django models, so it can service many user-provided datasets. To ease maintenance work, we'd like to generate the SQL statements to migrate database tables to a newer version of the schema. I've managed to use

Models Culculations

2022-08-03 Thread tech george
Hello, Please help with the below, I am trying to get dispense_quantity from Dispense Model and subtract it from the quantity on Stock Model. Then after that get something like this; @property def closing_stock(self): return (self.quantity - self. quantity_issued ) class

Re: Question about from integer models

2022-05-30 Thread Hansel Johansyah
UTC+5:30 jakartaman...@gmail.com wrote: > >> Hi Everyone >> >> I wanna question about the integer would input by models, with some class >> ClassName >> numb = models.IntegerField() >> and the views is : >> number = ClassName.objects.values_list('numb'

Re: Question about from integer models

2022-05-30 Thread Chiranjeevi Kodati
. Regards Chiranjeevi On Monday, 30 May 2022 at 15:36:07 UTC+5:30 jakartaman...@gmail.com wrote: > Hi Everyone > > I wanna question about the integer would input by models, with some class > ClassName > numb = models.IntegerField() > and the views is : > number = ClassNam

Question about from integer models

2022-05-30 Thread Hansel Johansyah
Hi Everyone I wanna question about the integer would input by models, with some class ClassName numb = models.IntegerField() and the views is : number = ClassName.objects.values_list('numb', flat=True).distinct() then the templates is : 1 2 3 4 5 so i call the number from django admin

Re: Chaining county/cites api to models

2022-05-06 Thread Heman Okumbo
"ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" I need to chain my models to this api such that after selecting the city,you a get a redirect to a form so you can fill in personal details On Fri, May 6, 2022, 12:36 Muhammad Juwaini Abdul Rahman wrote: > Can you s

Re: Chaining county/cites api to models

2022-05-06 Thread Muhammad Juwaini Abdul Rahman
heir products based on their >>> countries,States and cities.I got this api that show a drop down list based >>> on country, states and cities.How do I chain my models to this api? Any >>> leads will be appreciated.Thanks >>> >>> -- >>> You received t

Re: Chaining county/cites api to models

2022-05-06 Thread Heman Okumbo
ropdown-list-with-django.html > > On Thu, 5 May 2022 at 23:46, Heman Okumbo wrote: > >> I need to have clients posting their products based on their >> countries,States and cities.I got this api that show a drop down list based >> on country, states and cities.How do I ch

Re: Chaining county/cites api to models

2022-05-05 Thread Muhammad Juwaini Abdul Rahman
is api that show a drop down list based > on country, states and cities.How do I chain my models to this api? Any > leads will be appreciated.Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscri

Chaining county/cites api to models

2022-05-05 Thread Heman Okumbo
I need to have clients posting their products based on their countries,States and cities.I got this api that show a drop down list based on country, states and cities.How do I chain my models to this api? Any leads will be appreciated.Thanks -- You received this message because you

Re: Calculations Between Models

2022-04-22 Thread techg...@gmail.com
Hello Derek, Your solution worked, I appreciated the help. Regards. On Wednesday, April 20, 2022 at 5:50:25 PM UTC+3 Derek wrote: > Not sure what the "@aproperty" are here for, but in your views.py file, > you could do this calculation, passing in the ID of the staff record:

Re: Fetching Data Between Models

2022-04-21 Thread Derek
You've already posted the same question: https://groups.google.com/g/django-users/c/f7ZH2pcZp0s On Wednesday, 20 April 2022 at 16:44:19 UTC+2 techg...@gmail.com wrote: > I have a model Staff and LeaveReportStaff, I wanted to get leave_balance > between Total_Leave_Days and leave_days. I

Re: Calculations Between Models

2022-04-20 Thread Derek
Not sure what the "@aproperty" are here for, but in your views.py file, you could do this calculation, passing in the ID of the staff record: from .models import Staff, LeaveReportStaff def get_leave_balance(staff_id): total_leave_days = Staff.objects.get(pk=staff_id) lea

Fetching Data Between Models

2022-04-20 Thread tech george
I have a model Staff and LeaveReportStaff, I wanted to get leave_balance between Total_Leave_Days and leave_days. I already used Foreignkey for staff but I'm not sure if it is right to use Foreignkey again. Please advise the best way forward. class Staff(models.Model): Total_Leave_Days =

Calculations Between Models

2022-04-19 Thread tech george
Hello, I have a model Staff and LeaveReportStaff, I wanted to get leave_balance between Total_Leave_Days and leave_days. Please advise the best way forward. class Staff(models.Model): Total_Leave_Days = models.PositiveIntegerField(default=0) course = models.ForeignKey(Course,

Re: How to create dynamic models in django??

2022-03-14 Thread Joel Tanko
gt; explore the use of its associated technologies which can meet your stated > requirements. > > On Thursday, 10 March 2022 at 01:55:18 UTC+2 Ryan Nowakowski wrote: > >> On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote: >> > How to create dynamic models in django

Re: How to create dynamic models in django??

2022-03-10 Thread Derek
530, Prashanth Patelc wrote: > > How to create dynamic models in django rest framework? > > Is there any chance to create dynamic models with APIs > > > > Any examples please send me thanks in advance.. > > > > 1) Requirement is need create table name and fields in

Re: How to create dynamic models in django??

2022-03-09 Thread Ryan Nowakowski
On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote: > How to create dynamic models in django rest framework? > Is there any chance to create dynamic models with APIs > > Any examples please send me thanks in advance.. > > 1) Requirement is need create tab

Re: How to create dynamic models in django??

2022-02-28 Thread Clive Bruton
On 28 Feb 2022, at 16:24, Prashanth Patelc wrote: Any example? Just read the django-extra-views documentation. Essentially a formset can be as simple to use as any of the built-in class-based views, eg: from extra_views import InlineFormSetView class

Re: How to create dynamic models in django??

2022-02-28 Thread Prashanth Patelc
Any example? On Mon, Feb 28, 2022, 5:27 PM Clive Bruton wrote: > > On 27 Feb 2022, at 17:54, Steve Smith wrote: > > > ...the documentation on Formsets is scarce in my opinion and to get > > them to work is a lot of trial and error... > > To massively simplify formsets try django-extra-views > >

Re: How to create dynamic models in django??

2022-02-28 Thread Clive Bruton
On 27 Feb 2022, at 17:54, Steve Smith wrote: ...the documentation on Formsets is scarce in my opinion and to get them to work is a lot of trial and error... To massively simplify formsets try django-extra-views -- Clive -- You received this message because you are subscribed to the

Re: How to create dynamic models in django??

2022-02-27 Thread Shaheed Haque
Check out the api mentioned here https://stackoverflow.com/questions/34768732/temporary-models-in-django#48042468 On Sun, 27 Feb 2022, 03:42 Prashanth Patelc, wrote: > How to create dynamic models in django rest framework? > Is there any chance to create dynamic models with APIs &

Re: How to create dynamic models in django??

2022-02-27 Thread Steve Smith
@googlegroups.com on behalf of Antonis Christofides Sent: Sunday, February 27, 2022 12:58 AM To: django-users@googlegroups.com Subject: Re: How to create dynamic models in django?? Short answer: I don't know. It probably isn't straightforward, but it's doable in principle. Longer answer: Django hasn't been

Re: How to create dynamic models in django??

2022-02-27 Thread Heman Okumbo
Refer here.https://docs.djangoproject.com/en/4.0/topics/db/models/ On Sun, Feb 27, 2022, 06:42 Prashanth Patelc wrote: > How to create dynamic models in django rest framework? > Is there any chance to create dynamic models with APIs > > Any examples please send me thanks in adv

Re: How to create dynamic models in django??

2022-02-26 Thread Antonis Christofides
doing such things—it's likely to lead to an unmanageable code mess. Keep it simple. Consider working without a relational database. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 27/02/2022 05.40, Prashanth Patelc wrote: How to create dynamic models in django rest framework

How to create dynamic models in django??

2022-02-26 Thread Prashanth Patelc
How to create dynamic models in django rest framework? Is there any chance to create dynamic models with APIs Any examples please send me thanks in advance.. 1) Requirement is need create table name and fields in frontend 2) we are getting the data and store in to the db create db structure 3

how to use migrations in runtime for models creation?

2022-02-23 Thread Prashanth Patelc
hey , im working on dynamic models , im receiving model name and fields in front-end eg: class Users(models.Model): name=models.Charfield(max_length=30) last_name=models.Charfield(max_length=30) ,,, after this i dont need to save into the models.py i need to store the data

DB design(models), #tags, or labels, folders

2022-02-16 Thread Madhusudhan Reddy
Hi Django users, I have a requirement to design and develop labels for mailing and ticketing software. you can call whatever you want to labels or tags or folders or hashtags but how to design database for reusable case of designing database in django tags For example, 1. Mails 2. Ticketing.

Can I use session.userid in models FK restriction query?

2022-02-11 Thread lone...@gmail.com
Hello all, I am curious if I can use the session.userid in a model FK restriction query. Thank you. -- 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: Models

2022-01-21 Thread Mike Dewhirst
) To: Django users Subject: Models Dear Django users,I need some information regarding Django models, I would  like to  know is there any way to  create Django models through frontend or can we create models by super admin. Kindly share any tutorials or any examples available.Example:we are create

Models

2022-01-21 Thread Prashanth Patelc
Dear Django users, I need some information regarding Django models, I would like to know is there any way to create Django models through frontend or can we create models by super admin. Kindly share any tutorials or any examples available. Example: we are create models in django like below

Re: CSRF token missing on models with a file/imagefield

2021-12-28 Thread Yorben Verhoest
oblem occurs because for some reason my >> request.POST data is empty. >> >> I found out because I wrote a custom CSRFfailureview where I print out my >> request data. >> >> The reason I get a csrf is missing error is because that token is also >> stored in th

Re: CSRF token missing on models with a file/imagefield

2021-12-28 Thread Sebastian Jung
e I wrote a custom CSRFfailureview where I print out my > request data. > > The reason I get a csrf is missing error is because that token is also > stored in there. > > Now I'm trying to figure out why my POST data is empty only on models > where an filefield or imagefield is

Re: CSRF token missing on models with a file/imagefield

2021-12-27 Thread Yorben Verhoest
out why my POST data is empty only on models where an filefield or imagefield is defined... On Tuesday, 21 December 2021 at 07:59:31 UTC+1 Yorben Verhoest wrote: > Yes, I'm just using the DjangAdmin interface > > It works perfectly for models without any filefield / imagefield > Fir

Re: CSRF token missing on models with a file/imagefield

2021-12-20 Thread Yorben Verhoest
Yes, I'm just using the DjangAdmin interface It works perfectly for models without any filefield / imagefield First I thought that the connection between the app and the s3 bucket was wrong, but when I test i through the shell, it works. On Monday, 20 December 2021 at 19:50:28 UTC+1 phoebeb

Re: CSRF token missing on models with a file/imagefield

2021-12-20 Thread Phoebe Bright
e > data in it. > All of my models work fine when I try to save them except the ones that > have a filefield or imagefield in them. When I save those, I get a 403 - > CSRF token missing error. > > The weird thing is, working on localhost, It works perfectly, it even > saves the file

CSRF token missing on models with a file/imagefield

2021-12-20 Thread Yorben Verhoest
I have a project which is set up on AWS using lambda, s3, ... Because it is still in production we are using DjangoAdmin to manage the data in it. All of my models work fine when I try to save them except the ones that have a filefield or imagefield in them. When I save those, I get a 403

Re: Question regarding organizing models

2021-11-18 Thread Twizerimana Emmanuel
gt; https://docs.djangoproject.com/en/3.2/ref/models/fields/#foreignkey > > In this case you would do > > created_by_id = models.ForeignKey("User", on_delete=models.DO_NOTHING) > > On Sep 23, 2021, at 1:50 AM, Bhavin Shah > wrote: > > Hello, > > Somewhat n

Re: Question regarding organizing models

2021-11-14 Thread Peter of the Norse
You can put a string with the name of a class that is yet to be defined in the ForeignKey. https://docs.djangoproject.com/en/3.2/ref/models/fields/#foreignkey <https://docs.djangoproject.com/en/3.2/ref/models/fields/#foreignkey> In this case you would do created_by_id = models.Fore

Re: Sanitize field from xss attacks in django models

2021-11-06 Thread omar ahmed
> > On Saturday, 6 November 2021 at 12:44:05 UTC omark...@gmail.com wrote: > >> hi all >> i want to sanitize 'content' field from XSS attacks in django models >> so i installed 'bleach' and used but script like "an >> evil() example" store as is (wi

Re: Sanitize field from xss attacks in django models

2021-11-06 Thread Steven Mapes
validation in, then call super afterwards. You could also look at django-bleach - https://pypi.org/project/django-bleach/ On Saturday, 6 November 2021 at 12:44:05 UTC omark...@gmail.com wrote: > hi all > i want to sanitize 'content' field from XSS attacks in django models > so i installe

Sanitize field from xss attacks in django models

2021-11-06 Thread omar ahmed
hi all i want to sanitize 'content' field from XSS attacks in django models so i installed 'bleach' and used but script like "an evil() example" store as is (without sanitize script) Note: i need bleach via function in models Any idea ? Thanks [image: bleach-Models.png] -- Yo

Re: Question regarding organizing models

2021-09-23 Thread bnmng
tables with the third one so that its not a deadlock between the two > > On Thu, Sep 23, 2021 at 7:05 PM Bhavin Shah > wrote: > >> Hello, >> >> Somewhat new to Django. I am trying to figure out the best way to >> define/organize models in Django app which have interdepe

Django新增models和表的方法

2021-09-14 Thread anyi Tai
大家好 系統使用一段時間后,它滿足新的要求,需要添加一個新的表。如何使用它? -- 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

Re: UML to Django models

2021-08-27 Thread Ahmet Faruk Yılmaz
st 2021 at 16:14:04 UTC+1 abubak...@gmail.com wrote: >> >>> Hi Derek it is not difficult for me to write the model for the product >>> entity. but there are also other diagrams that I want to convert into >>> models. so I was just wanted to clear my concept. >>>

Re: UML to Django models

2021-08-26 Thread DJANGO DEVELOPER
21 at 16:14:04 UTC+1 abubak...@gmail.com wrote: > >> Hi Derek it is not difficult for me to write the model for the product >> entity. but there are also other diagrams that I want to convert into >> models. so I was just wanted to clear my concept. >> I am confused in Super type

Re: UML to Django models

2021-08-26 Thread Cale Roco
ote: > Hi Derek it is not difficult for me to write the model for the product > entity. but there are also other diagrams that I want to convert into > models. so I was just wanted to clear my concept. > I am confused in Super types and sub types as you can see an entity within >

Re: UML to Django models

2021-08-26 Thread DJANGO DEVELOPER
Hi Derek it is not difficult for me to write the model for the product entity. but there are also other diagrams that I want to convert into models. so I was just wanted to clear my concept. I am confused in Super types and sub types as you can see an entity within the entity. how should I convert

Re: UML to Django models

2021-08-26 Thread Derek
There is not sufficient data in that image to create models. You don't know the field types, for example. Once you have those, it should not be too hard e.g.: from django.db import models class Product(models.Model): product_id = models.AutoField() name = models.CharField( max_length

Re: UML to Django models

2021-08-26 Thread DJANGO DEVELOPER
can anyone help me? On Thu, Aug 26, 2021 at 9:32 AM DJANGO DEVELOPER wrote: > Currently, I am working on an inventory management system and I have got > some UML diagrams and want to convert those uml diagrams into django > models. So can anyone guide me on how to convert those UML

UML to Django models

2021-08-25 Thread DJANGO DEVELOPER
Currently, I am working on an inventory management system and I have got some UML diagrams and want to convert those uml diagrams into django models. So can anyone guide me on how to convert those UML diagrams into django models? an example is below of uml diagram -- You received this message

HOW TO ADD SKIP LOGIG TO DJANGO MODELS

2021-07-29 Thread Winstone Makwesheni
Hello guys,can anyone help me to add skip logic to django models, i feel too lazy to use Django Forms and then add javascript and jquery, is there a way to add them directly to models? Cheers Winstone -- You received this message because you are subscribed to the Google Groups "Django

Re: Adding Two Models In Django

2021-06-17 Thread Ayush Bisht
models.DecimalFIeld() >>>Total_score = models.DecimalField(default = 0) >>> >>>*def save(self, *args, **kwargs):* >>> * self.Total_score = self.maths_score + self.english_score* >>> super(Student, self).save(*args, **kwar

Re: Adding Two Models In Django

2021-06-16 Thread Ridwan Adeyemo
_score = self.maths_score + self.english_score* > super(Student, self).save(*args, **kwargs) > > > > or you can proceed with clean() method also. > On Tuesday, June 15, 2021 at 11:34:37 AM UTC-7 adesolar...@gmail.com > wrote: > >> How do I add two models together

Re: Adding Two Models In Django

2021-06-16 Thread Ayush Bisht
() method also. On Tuesday, June 15, 2021 at 11:34:37 AM UTC-7 adesolar...@gmail.com wrote: > How do I add two models together in the database, two different > DecimalField. > i.e math_score + eng_score = total_score > -- You received this message because you are subscribed to the G

Re: Adding Two Models In Django

2021-06-16 Thread Ridwan Adeyemo
t; Regards > > Ridwan Adeyemo schrieb am Di., 15. Juni > 2021, 20:34: > >> How do I add two models together in the database, two different >> DecimalField. >> i.e math_score + eng_score = total_score >> >> -- >> You received this message be

Re: Adding Two Models In Django

2021-06-15 Thread Sebastian Jung
Hello, You create all modelfields inkl. Total sum and after user submit Form with 2 fields in save() Method you sum both fields together ans write this in total field... Regards Ridwan Adeyemo schrieb am Di., 15. Juni 2021, 20:34: > How do I add two models together in the database,

Re: Adding Two Models In Django

2021-06-15 Thread Ridwan Adeyemo
Thanks for the response. Kindly explain more or provide image description. Best regards On Tue, Jun 15, 2021, 8:09 PM patel dhruvish wrote: > Use foreign key in 1 model for initiat another model... > > On Wed, Jun 16, 2021, 00:04 Ridwan Adeyemo > wrote: > >> How do I ad

Re: Adding Two Models In Django

2021-06-15 Thread patel dhruvish
Use foreign key in 1 model for initiat another model... On Wed, Jun 16, 2021, 00:04 Ridwan Adeyemo wrote: > How do I add two models together in the database, two different > DecimalField. > i.e math_score + eng_score = total_score > > -- > You received this message because

Adding Two Models In Django

2021-06-15 Thread Ridwan Adeyemo
How do I add two models together in the database, two different DecimalField. i.e math_score + eng_score = total_score -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Models Mixin Inherit Many to Many

2021-06-04 Thread sebasti...@gmail.com
Hello, i need a mixin where i can inherit many to many like this: mixin.py: class RightsModelRelation(models.Model): user_link = models.ForeignKey(User, on_delete=models.CASCADE, blank=False, null=False, default=None,

Re: Inlined hierarchy models in django admin site.

2021-06-01 Thread DJANGO DEVELOPER
I think this the only way to lin different models with eachother. and I would like to hear more about linking the models with each other if there is anyone who can describe it to both of us. On Wed, Jun 2, 2021 at 10:38 AM Ayush Bisht wrote: > thanks, .. it works for me.. but is there any ot

Re: Inlined hierarchy models in django admin site.

2021-06-01 Thread Ayush Bisht
thanks, .. it works for me.. but is there any other way to do these ??. as PatientVaccineStatus already connected to Patient model, and Vaccine connected to PatientVaccineStatus model. Can't we merged all the tables of descendants to their parent model in this hierarchy fashion without linking

Re: Inlined hierarchy models in django admin site.

2021-06-01 Thread DJANGO DEVELOPER
btw have you applied in your models what I told you to do? On Wed, Jun 2, 2021 at 10:31 AM Ayush Bisht wrote: > yes, its true, but here it works as candidate key. so that we can identify > the patient based in ICMR id's. > > On Tuesday, June 1, 2021 at 1:34:24 AM UTC-7 abubak...@gma

Re: Inlined hierarchy models in django admin site.

2021-06-01 Thread Ayush Bisht
yes, its true, but here it works as candidate key. so that we can identify the patient based in ICMR id's. On Tuesday, June 1, 2021 at 1:34:24 AM UTC-7 abubak...@gmail.com wrote: > class Patient(models.Model): > patient_id = models.CharField(max_length=60) # no need for adding > patient

Re: Inlined hierarchy models in django admin site.

2021-06-01 Thread DJANGO DEVELOPER
class Patient(models.Model): patient_id = models.CharField(max_length=60) # no need for adding patient id because django automatically creates ids patient_vaccine = models.ForeignKey(PatientVaccine, related_name="patient_vaccine") vaccine = models.ForeignKey(Vaccinet,

Re: Inlined hierarchy models in django admin site.

2021-06-01 Thread DJANGO DEVELOPER
class Vaccine(models.Model) vaccine = models.ForeignKey(PatientVaccineStatus, related_name="vaccine_status") patient = models.ForeignKey(Patient, related_name="patient") # new line apply this line and your patient model will be linked with Vaccine model On Tue, Jun 1, 2021 at 11:06 AM

Inlined hierarchy models in django admin site.

2021-06-01 Thread Ayush Bisht
class Patient(models.Model): patient_id = models.CharField(max_length=60) class PatientVaccineStatus(models.Model): patient = models.ForeignKey(Patient, related_name="patient_vaccine_status") class Vaccine(models.Model) vaccine = models.ForeignKey(PatientVaccineStatus,

Re: Question about models. test

2021-05-02 Thread Peter of the Norse
This kind of script can be dangerous. It’s possible for malicious websites to create a page that can use up too many resources or otherwise act strangely. URLValidator

Using Signals and method in models to automate key and qrcode>> help

2021-04-17 Thread Tal Bar-Or
advice Thanks *The profile model* from django.db import models from django.contrib.auth.models import User import pyotp import qrcode # Create your models here. def otp_google_auth(code,usr): print('details: ',code,usr) googleauth = pyotp.totp.TOTP(code).provisioning_uri(name=str

  1   2   3   4   5   6   7   8   9   10   >