Re: Is it possible to create models inside a database model

2018-07-11 Thread mottaz hejaze
you cant make models inside models becouse you cant make tables inside tables ... a model is a database table aditya the easiest way is to redesign your model and make it of 15 fields ..each field will upload to a specific folder inside the media folder another way . is to make a one image field

Re: Is it possible to create models inside a database model

2018-07-11 Thread mottaz hejaze
for alexander .. you can make three models .. one for orders .. one for items .. and one for orderedItems .. the orderedItems model will have relations to both models items and orders On Tue, 10 Jul 2018, 21:19 aditya gupta, wrote: > Well I was thinking is that instead of using related_name is

Re: Is it possible to create models inside a database model

2018-07-10 Thread aditya gupta
Well I was thinking is that instead of using related_name is there any other way I can write and call my images inside css lightbox for the slide show. On Wed, Jul 11, 2018, 12:42 AM Alexander Joseph < alexander.v.jos...@gmail.com> wrote: > Oh ok I see. The related_name is what you use to access

Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
Oh ok I see. The related_name is what you use to access the specific field in the template so it needs to be unique to the model field. When you use the ForeignKey field type it uses the primaryKey of the related database models automatically so you dont need to worry about actually telling it

Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
Also- this is assuming you're using CBVs, if youre just using FBVs its probably even easier on the view side, the model side would be the same On Tuesday, July 10, 2018 at 10:23:51 AM UTC-6, Alexander Joseph wrote: > > Good question - I'm looking for a similar solution myself. My application > i

Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
Good question - I'm looking for a similar solution myself. My application is a purchase order app so that a purchase order has details about the purchase order but also has an unspecified number of objects that belong to it (purchase items). The only way I can think this MIGHT work is making a m

Is it possible to create models inside a database model

2018-07-10 Thread aditya
I have created a model Named Gallery and set upload path to media folder and in that folder I have 15 more folders with different images. Now I want to access each folder and images present inside it using database. My question is : Is it possible to create 15 model inside an model and if possibl