Require an inventory model tutorial in Django

294 views
Skip to first unread message

Heenashree Khandelwal

unread,
Dec 1, 2017, 7:20:45 AM12/1/17
to Django users
Hi, I am new to Django. I  want to create an inventory model (or capacity management model ). I have environments. These environments have servers (with different flavors, like CPU, RAM etc). On the basis of the user requirements, (where user inputs cpu, ram, cpu model etc), we calculate and give the user an environment. I want to keep the model as simple as possible (since I am new to this work anyway). I tried this with eCommerce but that didn't work. If anyone has any ideas/tutorials/articles/sourcecode that may help me to get started, it would be a great help  

PS. I have below database structure. The db can be changed as per the feasibility. 


Jason

unread,
Dec 1, 2017, 8:33:27 AM12/1/17
to Django users
A good first step would be going through the django tutorial at https://docs.djangoproject.com/en/1.11/intro/tutorial01/
Also, Victor Frietas has written an excellent starter series for complete beginners to Django at https://simpleisbetterthancomplex.com/series/beginners-guide/1.11/

The structure you have displayed is pretty easy to implement with django, so I think once you get past the tutorials, adapting your schema to django models will be easy and you'll also have an understanding of how to use django for your project goals.

carlos

unread,
Dec 1, 2017, 10:15:23 AM12/1/17
to django...@googlegroups.com
Hi, if you have the db, try this for auto-generate complete models.
https://docs.djangoproject.com/en/1.11/howto/legacy-databases/#auto-generate-the-models

cheers

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/90d9d364-ae01-415a-b113-ab6bc1553135%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
att.
Carlos Rocha

Heenashree Khandelwal

unread,
Dec 2, 2017, 1:39:09 AM12/2/17
to Django users
Hi Jason, thanks for your response. I actually had gone through tutorials and I was able to get the idea of how the ORM works but in this scenario, since this is just the first few steps of the project, I have issues like, 
1. A form that takes the input from user (requirements in the table). The user inputs will be requirements (cpu, memory, cpu model etc. and this is a json object). The user also tells what type of hardware he needs (router, networks etc) and softwares (oracle, microsoft). Here the challenge is, once the user input the requirements(JSON object), how do I compare this with the inventory (This inventory is something I still need to build. If you see specs in the table, thats the specifications of an environment that we have and that too should be JSON). 

2. Howsoever I deal with the user input, I am suppose to make comparisons, (ESTIMATE table) and then give an environment to the user. (An environment is like what kind of VMs suits the requirement of the user). 

3. I am not sure about this database as well. I was thinking that may be I should put the details that user put in ITEM table. Take these values from ITEM table and store in ESTIMATE table after making some calculations. Finally from ESTIMATE, make comparisons and give an ENVIRONMENT to the user. 

I am not sure if I was able to explain this. If you may wonder why JSON object, the idea is that inventory may have many things added in the future. I am not able to get these things straight. 

Heenashree Khandelwal

unread,
Dec 2, 2017, 1:39:37 AM12/2/17
to Django users
I am definitely going to try this. 


On Friday, 1 December 2017 20:45:23 UTC+5:30, sacrac wrote:
Hi, if you have the db, try this for auto-generate complete models.
https://docs.djangoproject.com/en/1.11/howto/legacy-databases/#auto-generate-the-models

cheers
On Fri, Dec 1, 2017 at 7:33 AM, Jason <jjohn...@gmail.com> wrote:
A good first step would be going through the django tutorial at https://docs.djangoproject.com/en/1.11/intro/tutorial01/
Also, Victor Frietas has written an excellent starter series for complete beginners to Django at https://simpleisbetterthancomplex.com/series/beginners-guide/1.11/

The structure you have displayed is pretty easy to implement with django, so I think once you get past the tutorials, adapting your schema to django models will be easy and you'll also have an understanding of how to use django for your project goals.

--
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...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.



--
att.
Carlos Rocha
Reply all
Reply to author
Forward
0 new messages