Re: Data model design questio: graph in database

2024-02-29 Thread Sébastien Hinderer
Dear Ryan, 'Ryan Nowakowski' via Django users (2024/02/26 17:39 -0600): > You might consider using GenericRelation. That would allow you to query the > edges that have a certain vertex type. > > https://docs.djangoproject.com/en/5.0/ref/contrib/contenttypes/#generic-relations That looks indeed

Re: Data model design questio: graph in database

2024-02-26 Thread Sébastien Hinderer
Dear mike, Mike Dewhirst (2024/02/27 17:10 +1100): > On 26/02/2024 8:00 pm, Sébastien Hinderer wrote: > > I will thus need to find a way to disable in the admin interface the > > possibility to work directly on the Vertex and Edge classes, but I > > expect the documentation will tell me how to ach

Re: Data model design questio: graph in database

2024-02-26 Thread Mike Dewhirst
On 26/02/2024 8:00 pm, Sébastien Hinderer wrote: I will thus need to find a way to disable in the admin interface the possibility to work directly on the Vertex and Edge classes, but I expect the documentation will tell me how to achieve this. In fact you need to enable the classes you want -

Re: Data model design questio: graph in database

2024-02-26 Thread Sébastien Hinderer
Hi again, Jason (2024/02/25 17:28 -0800): > Question about this, why focus on using a rdbms for this functionality vs > using an actual graph db like neo4j with neomodel > ? I'm actually a bit nervous about giving up completely the relational mo

Re: Data model design questio: graph in database

2024-02-26 Thread Sébastien Hinderer
t; find such an approach very comforting.CheersMike--(Unsigned mail from my > phone) > Original message From: Sébastien Hinderer > Date: 25/2/24 21:46 (GMT+10:00) To: > django-users@googlegroups.com Subject: Re: Data model design questio: graph > in database De

Re: Data model design questio: graph in database

2024-02-26 Thread Sébastien Hinderer
Dear Jason, Many thanks! Jason (2024/02/25 17:28 -0800): > Question about this, why focus on using a rdbms for this functionality vs > using an actual graph db like neo4j with neomodel > ? Oh simply because I was absolutely not aware of the exi

Re: Data model design questio: graph in database

2024-02-25 Thread Jason
Question about this, why focus on using a rdbms for this functionality vs using an actual graph db like neo4j with neomodel ? On Sunday, February 25, 2024 at 7:59:31 PM UTC-5 Mike Dewhirst wrote: > Re-reading your question perhaps I was too brie

Re: Data model design questio: graph in database

2024-02-25 Thread Mike Dewhirst
Re-reading your question perhaps I was too brief in my earlier response. Let me assume all your actual edges and vertices are objects of child classes. I also assume your base Edge and Vertex classes are abstract for inheritance purposes only. It doesn't matter whether instances of edges and v

Re: Data model design questio: graph in database

2024-02-25 Thread Mike Dewhirst
expect. I find such an approach very comforting.CheersMike--(Unsigned mail from my phone) Original message From: Sébastien Hinderer Date: 25/2/24 21:46 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: Data model design questio: graph in database Dear Mike,I will

Re: Data model design questio: graph in database

2024-02-25 Thread Sébastien Hinderer
Dear Mike, I will definitely play aroudn with your nice suggestion, but I would like to share a concern I have. At this stage I am actually unsure how this will work. Indeed, suppose a vertex is given as input and one tries to query the database about all the edges that originate from this vertex

Re: Data model design questio: graph in database

2024-02-25 Thread Sébastien Hinderer
Dear Mike, Many thanks for your suggestion! I find it significantly superior to what I had in mind, in the sense that I would have had to handle the class types manually, with the obvious drawbacks (error-prone, not so easy to extend), which your solution completely avoids. I will thus definitel

Re: Data model design questio: graph in database

2024-02-24 Thread Mike Dewhirst
On 24/02/2024 7:20 am, Sébastien Hinderer wrote: Dear all, Using the mailing list rather than the forum because, like many visually impaired people, I find mailing lists way easier to use than forums, I hope the list is still active. I need to store in database and manipulate graphs of which bo

Data model design questio: graph in database

2024-02-23 Thread Sébastien Hinderer
Dear all, Using the mailing list rather than the forum because, like many visually impaired people, I find mailing lists way easier to use than forums, I hope the list is still active. I need to store in database and manipulate graphs of which both vertices and edges can each be of several types.

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: Model Design

2022-05-06 Thread Lunga Baliwe
Also/maybe if you haven't please check https://django-import-export.readthedocs.io/en/latest/ On Thu, May 5, 2022 at 3:59 PM 'David Turner' via Django users < django-users@googlegroups.com> wrote: > We receive the data every two weeks and then use django-import-export to > import the data into ou

Re: Model Design

2022-05-05 Thread Ayser shuhaib
It shouldn’t impact cause you can set that field to be (blank=True, null=True) in this case it won’t raise an error and you can attach the imported data to the related account manager. This is how I see it I hope this helps On Thu, 05 May 2022 at 15:59, 'David Turner' via Django users < django-use

Re: Model Design

2022-05-05 Thread 'David Turner' via Django users
We receive the data every two weeks and then use django-import-export to import the data into our database. There is no mention of the account manager in these as this is something on our side. Am I missing the point in that by having the foreign key to the account manager this would impact on t

Re: Model Design

2022-05-05 Thread Ayser shuhaib
To help understand more the problem, would you please explain why adding an extra field to your models to be used as a foreign key, is not an option? On Thu, 05 May 2022 at 15:36, 'dtdave' via Django users < django-users@googlegroups.com> wrote: > We receive data from various third parties in the

Re: Model Design

2022-05-05 Thread Agnese Camellini
i would decouple the importing of data from the database architecture, and make a meaningfould structure of the models, but your own, not the one of the client. In this manner you create a design that is meaningful and can be scaled from the knowledge expressed in the data without being dependant f

Model Design

2022-05-05 Thread 'dtdave' via Django users
We receive data from various third parties in their proprietary format in excel. We then import this into our database and our models have been designed around their format. There is no option to change the way this data is received. However, we now need to add an account manager to this data and

Re: Model Design Questions

2017-12-22 Thread Mark Phillips
The purpose of the site is to search for a set of documents > that share some given set of metadata values. I am wrestling with the model > design for the metadata part of this project. > > I have identified about 30 internal metadata types particular to these > documents, and not rel

Re: Model Design Questions

2017-12-17 Thread James Schneider
ts (photos, pdfs, videos) now, and that number could double in the next year. The purpose of the site is to search for a set of documents that share some given set of metadata values. I am wrestling with the model design for the metadata part of this project. I have identified about 30 internal meta

Re: Model Design Questions

2017-12-17 Thread Jani Tiainen
and that number could double in > the next year. The purpose of the site is to search for a set of documents > that share some given set of metadata values. I am wrestling with the model > design for the metadata part of this project. > > I have identified about 30 internal metadata types

Re: Model Design Questions

2017-12-16 Thread Matemática A3K
f the site is to search for a set of documents >> that share some given set of metadata values. I am wrestling with the model >> design for the metadata part of this project. >> >> I have identified about 30 internal metadata types particular to these >> documents, and not

Re: Model Design Questions

2017-12-16 Thread Dan Tagg
ch for a set of documents > that share some given set of metadata values. I am wrestling with the model > design for the metadata part of this project. > > I have identified about 30 internal metadata types particular to these > documents, and not related to any standards. If I use Dub

Model Design Questions

2017-12-16 Thread Mark Phillips
the next year. The purpose of the site is to search for a set of documents that share some given set of metadata values. I am wrestling with the model design for the metadata part of this project. I have identified about 30 internal metadata types particular to these documents, and not related to any

Re: Model design question

2017-06-25 Thread Mark Phillips
On Sun, Jun 25, 2017 at 6:56 PM, Constantine Covtushenko < constantine@gmail.com> wrote: > Hi Mark, > > I have some questions to you. > 1. Does any of MetaData have predefined list of MetaDataValues? > No, I want to add them in real time as Documents are uploaded. > 2. Can MetaDataValue be

Re: Model design question

2017-06-25 Thread Constantine Covtushenko
Hi Mark, I have some questions to you. 1. Does any of MetaData have predefined list of MetaDataValues? 2. Can MetaDataValue be assigned to many Documents or it is specific to particular Document? Regards, Constantine C. On Sun, Jun 25, 2017 at 6:20 PM, Mark Phillips wrote: > I have a class Doc

Model design question

2017-06-25 Thread Mark Phillips
I have a class Document that uploads a document. I have a class MetaData that is the name for some metadata for that document. Since a MetaData can have one or more values, there is another class called MetaDataValue that has a ForeignKey to MetaData. Finally, there is a class DocumentMetaDataValue

Re: Django Model design

2016-03-27 Thread Bob Gailer
On Mar 27, 2016 9:41 AM, "Paria Parsamanesh" wrote: > > Hi , > I am new to Django and python and I want to connect to cloudera metadata database (postgre. ) > I have background in java, and db2, to design java model classes , we used logical data model and create UML modeling tools. . > > Can you

Django Model design

2016-03-27 Thread Paria Parsamanesh
Hi , I am new to Django and python and I want to connect to cloudera metadata database (postgre. ) I have background in java, and db2, to design java model classes , we used logical data model and create UML modeling tools. . Can you direct me on 1) How to make this connect from Django on window

Re: Best Practices Model Design

2015-01-30 Thread Tobias Dacoir
Hi, I'm quite new to Django myself. I doubt anyone is going through your whole Models File. You should have at least copy & pasted it from some kind of IDE to preserve the indention level. As for your other questions about the url to user-/profilename, have you looked at the tutorial: https:/

Best Practices Model Design

2015-01-30 Thread G Z
as well as a how do I do this question. Qustion #1: How do I set up my models field so that when a user uploads an image to a filefield it attaches the users name to the file that is being uploaded? Should I do this in the view or in the database? Question #2: Examine my model design and t

Re: Model Design, Nesting by Year

2014-04-29 Thread Venkatraman S
Why not have separate models for Event and Season and then use an intermediate table to capture the M2M between event occurrences and Person. On Thu, Apr 24, 2014 at 12:43 AM, Christopher Grande wrote: > I'm in the process of designing an internal system and I'm having trouble > designing the mo

Model Design, Nesting by Year

2014-04-23 Thread Christopher Grande
I'm in the process of designing an internal system and I'm having trouble designing the model so that it will function as I need it. The basic idea is that everything is "Season" based, where a season is a year (2014, 2015, etc) >From the there we have Events and the the Seasons they are functi

Re: Model Design: Adding Params to Relationship FIelds

2013-11-21 Thread Thomas Murphy
Thanks Daniel! I try to always RTFM, but this slipped by me. On Thu, Nov 21, 2013 at 5:32 AM, Daniel Roseman wrote: > On Wednesday, 20 November 2013 22:49:28 UTC, Thomas Murphy wrote: >> >> Hi all, >> >> I'm working on a hour-reporting system. >> >> Each Project has many Users, and each User has

Re: Model Design: Adding Params to Relationship FIelds

2013-11-21 Thread Daniel Roseman
On Wednesday, 20 November 2013 22:49:28 UTC, Thomas Murphy wrote: > > Hi all, > > I'm working on a hour-reporting system. > > Each Project has many Users, and each User has many Projects(These are > established and working nicely). > > My design issue is this: > How can I assign each User an I

Model Design: Adding Params to Relationship FIelds

2013-11-20 Thread Thomas Murphy
Hi all, I'm working on a hour-reporting system. Each Project has many Users, and each User has many Projects(These are established and working nicely). My design issue is this: How can I assign each User an IntegerField "Hours" on each Project they are assigned to? This Integer Field is personal

Re: Model design question

2012-05-18 Thread oneroler
Mike, Anssi, Thank you for your replies. I will give this a shot and see if I can get it to work. Sam On Thursday, May 17, 2012 9:59:40 PM UTC-7, akaariai wrote: > > On May 18, 5:25 am, oneroler wrote: > > Thanks Mike, that is what I was originally planning to do but realized > > there woul

Re: Model design question

2012-05-17 Thread akaariai
On May 18, 5:25 am, oneroler wrote: > Thanks Mike, that is what I was originally planning to do but realized > there would be situations where that wouldn't do exactly what I wanted. > For example, if there is a business that only has the strategy 'wholesale' > assigned, using ForeignKey would sti

Re: Model design question

2012-05-17 Thread Mike Dewhirst
On 18/05/2012 12:25pm, oneroler wrote: Thanks Mike, that is what I was originally planning to do but realized there would be situations where that wouldn't do exactly what I wanted. For example, if there is a business that only has the strategy 'wholesale' assigned, using ForeignKey would stil

Re: Model design question

2012-05-17 Thread oneroler
Thanks Mike, that is what I was originally planning to do but realized there would be situations where that wouldn't do exactly what I wanted. For example, if there is a business that only has the strategy 'wholesale' assigned, using ForeignKey would still allow me to assign a different strate

Re: Model design question

2012-05-17 Thread Mike Dewhirst
On 18/05/2012 7:02am, oneroler wrote: I'm trying to setup my first app and I'm trying to figure out the best way to have constraints on a particular field (strategy for class Division noted below). Below is the basic model structure. What I would like is for the strategy under a Division to b

Model design question

2012-05-17 Thread oneroler
I'm trying to setup my first app and I'm trying to figure out the best way to have constraints on a particular field (strategy for class Division noted below). Below is the basic model structure. What I would like is for the strategy under a Division to be constrained to the strategies select

Model design question

2011-01-22 Thread Yarin miran
Hello everyone I just started with django and was wondering how to do the following behaivor in my models: class Game(models.Model) characters_count = models.IntegerField(default=1) #basically i set to a choice of 1-3 class Match(models.Model) video=models.ForeignKey(Game) p1char1 = models.Fo

Re: m2m with intermediary - model design? Disappears from Django-Admin?

2010-06-24 Thread iliveinapark
ist_display = ('title', 'publication_date', 'entry_date', > > > > 'category', 'subject', 'source_publication', 'weekly_summary') > > > >     list_editable = ('publication_date', 'category&#

Re: m2m with intermediary - model design? Disappears from Django-Admin?

2010-06-24 Thread Victor Hooi
#x27;category', > > > 'subject', 'source_publication') > > >     search_fields = ('title', 'publication_date', 'abstract', > > > 'category__name', 'subject__name', 'source_publication__name&#

Re: m2m with intermediary - model design? Disappears from Django-Admin?

2010-06-24 Thread iliveinapark
x27;subject__name', 'source_publication__name', > > 'page_number', 'url') > > > However, there's still no visible widget for "FirmRating" on the "Add > > Article" page. > > > I can't tell just from the docs, but is thi

Re: m2m with intermediary - model design? Disappears from Django-Admin?

2010-06-24 Thread Victor Hooi
x27;, > 'category__name', 'subject__name', 'source_publication__name', > 'page_number', 'url') > > However, there's still no visible widget for "FirmRating" on the "Add > Article" page. > > I can't

Re: m2m with intermediary - model design? Disappears from Django-Admin?

2010-06-24 Thread Victor Hooi
nly for use on the main Article list page, but not on the Add Article page? Or is the above admin code meant to make the widget visible on the "Add Article" page as well? Cheers, Victor On Jun 25, 10:01 am, Victor Hooi wrote: > heya, > > NB: This is a followup to this: > > http://gr

m2m with intermediary - model design? Disappears from Django-Admin?

2010-06-24 Thread Victor Hooi
heya, NB: This is a followup to this: http://groups.google.com/group/django-users/browse_thread/thread/0fdc1dfb1fddb97b/6b559dc4abf5d4ea but I thought I'd also ask about the model design. To provide some background, we have a Django app that contains a list of journal articles. Each &qu

Re: Model design graphically or UML

2010-05-23 Thread Jasper Kennis
¿Do you know and recommend any visual tool for model design? Better if > database independent > > thanks in advance !! > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to dj

Model design graphically or UML

2010-05-23 Thread Jon
Hello, Trying to include some graph tool for managing and sharing data models visually. Testes mysql workbench, dia, graphivz and recently read some about argoUML.. ¿Do you know and recommend any visual tool for model design? Better if database independent thanks in advance !! -- You

Model design question: Inheritance? GenericRelation? ...?

2010-02-10 Thread Achim Domma
Hi, I have different models A,B,C which all will have exactly on Address. If I query instances of A,B,C I usually will also need the related address. I also want to query all instances of A,B,C which have a certain zip code for example. What's the best and most efficient way to model that in djang

Re: model design and derived classes - need advice please?

2010-02-02 Thread Tomasz Zieliński
On 2 Lut, 16:06, Simon Davies wrote: > Hi > > I am writing a web shop.  I have a shopping cart class, which has a > many to many relationship to an item class, the item class has three > derived classes.  The basic schema is shown below: > > class Item(models.Model): >         title = models.CharF

model design and derived classes - need advice please?

2010-02-02 Thread Simon Davies
Hi I am writing a web shop. I have a shopping cart class, which has a many to many relationship to an item class, the item class has three derived classes. The basic schema is shown below: class Item(models.Model): title = models.CharField(max_length=100) description = models.Ch

Re: Inventory model design

2009-12-16 Thread kmpm
Hi, I will try to give my shot at this. I would create one 'Item' model which have common fields like description, product category etc. For quantities I would create a system of units and unit conversion tables for each item using one model called 'Unit' and one called 'ItemUnit' or similar. Unit

Inventory model design

2009-12-15 Thread yummy_droid
Hi, I wanted to design a system that would keep inventory data for items. The items themselves are different enough, that they don't conform to a simple model. E.g., the products are for a bakery company. The company keeps inventory of solid items, liquid items, and items that are used in partial

Re: model design problem

2009-12-07 Thread Bill Freeman
Or there's overriding the metaclass... On Mon, Dec 7, 2009 at 12:39 PM, Bill Freeman wrote: > Hmmm.  Probably just as ugly, and untested, but: > > class A(basemodel): >    for o in range(MAXNUMREDPORTS): >         for i in (1,2): >             locals()["Port%d_redfield%d" % (o+1, i)] = models.Flo

Re: model design problem

2009-12-07 Thread Bill Freeman
Hmmm. Probably just as ugly, and untested, but: class A(basemodel): for o in range(MAXNUMREDPORTS): for i in (1,2): locals()["Port%d_redfield%d" % (o+1, i)] = models.FloatField() ... On Mon, Dec 7, 2009 at 12:10 PM, Daniel Goertzen wrote: > Okay, I explored model gener

Re: model design problem

2009-12-07 Thread Bill Freeman
Unless I'm very confused, django will happily delete your related objects (since they don't have anything to relate to anymore). Many to many would be more problematic. As far as creating a set of ports, you were stuck with that anyway, if I understand your original approach correctly. Even if y

Re: model design problem

2009-12-07 Thread Preston Holmes
On Dec 7, 8:56 am, Daniel Goertzen wrote: > Thanks for the reply Bill.  The problem I had with that approach is that > after creating the product I have to worry about creating red and green > ports.  Likewise, upon deletion, I have to mop up the ports.  Looking > through the documentation, I di

Re: model design problem

2009-12-07 Thread Daniel Goertzen
Okay, I explored model generation a bit and found an approach that wasn't too offensive. For those that are trying to solve the same problem that I am, here is what I came up with: def red_port(prefix): return """ %(prefix)sredfield1 = models.FloatField() %(prefix)sredfield2 = models.FloatFie

Re: model design problem

2009-12-07 Thread Daniel Goertzen
Thanks for the reply Bill. The problem I had with that approach is that after creating the product I have to worry about creating red and green ports. Likewise, upon deletion, I have to mop up the ports. Looking through the documentation, I did not find a way to bury this behavior in the Model.

Re: model design problem

2009-12-07 Thread Bill Freeman
I'm not clear on what you need to store, so I'll assume that you have individual data to store for each port of each type, and it is unrelated to data stored for another instance of the same or a different product. What comes to mind is that there is a "Product" model and a "Port" model (or if red

Re: model design problem

2009-12-07 Thread Daniel Goertzen
Each port would have about a half-dozen fields, and different port types are totally different from one another. I won't be querying port fields. I've thought about your JSON field trick before, but not with the nice wrapper methods. Good idea, thanks! The solution does have flaws, but if nothi

Re: model design problem

2009-12-07 Thread Shawn Milochik
What kind of information will the database have to store about the ports themselves? How will you need to be able to filter querysets by information in the port fields, if at all? I'm going to throw this one solution out there, but depending on your needs it may not fit: Create a red_ports co

model design problem

2009-12-07 Thread Dan
I am relatively new to django and relational databases, and need some Model advice. I have a family of network products each with a different combination of ports.. I will call them red ports and green ports. For example, product A will have its own Model and could have 2 red ports and 1 green po

Re: Model design

2009-10-29 Thread Caisys
Dear Vinicius, What is the difference between: -- def __unicode__(self): return unicode(self.place)+' - '+self.nome -- and -- def __unicode__(self): return self.place+' - '+self.nome -- because the both seem to work and display the same inf

Re: Model design

2009-10-26 Thread Daniel Roseman
On Oct 25, 11:47 pm, Caisys wrote: > Thanks but I am not very familiar with forms yet I barely managed to > override the default form. > However, I thought that its ok for the time being since places and > subplaces are not changed frequently so i can live with it for the > time being and move to

Re: Model design

2009-10-26 Thread Vinicius Mendes | meiocodigo.com
def __unicode__(self): return unicode(self.place)+' - '+self.nome On Oct 25, 8:47 pm, Caisys wrote: > Thanks but I am not very familiar with forms yet I barely managed to > override the default form. > However, I thought that its ok for the time being since places and > subplaces are not cha

Re: Model design

2009-10-25 Thread Caisys
Thanks but I am not very familiar with forms yet I barely managed to override the default form. However, I thought that its ok for the time being since places and subplaces are not changed frequently so i can live with it for the time being and move to more important parts until I am more familiar

Re: Model design

2009-10-25 Thread Vinicius Mendes | meiocodigo.com
On Oct 25, 4:53 am, Caisys wrote: > > Just override the form in the inlne admin. All you have to do is set a > > default in the field you want. > > I managed to do that but now all the extra fields have the default > text not just one. > What about overriding the formset? You override the __init

Re: Model design

2009-10-25 Thread Caisys
> Just override the form in the inlne admin. All you have to do is set a > default in the field you want. I managed to do that but now all the extra fields have the default text not just one. > In this case i prefer the approach of creating a "fake" field called > places, populated with the plac

Re: Model design

2009-10-24 Thread Vinicius Mendes | meiocodigo.com
On Oct 24, 7:14 am, Caisys wrote: > Thanks !!! I also felt the second sounds more "right" which leads to > two requirements, the first is for convenience but the second is a > must: > > 1) On the admin page for add Place I will put 2 or 3 slots for adding > Subplace to a place ... is there a wa

Re: Model design

2009-10-24 Thread Caisys
Thanks !!! I also felt the second sounds more "right" which leads to two requirements, the first is for convenience but the second is a must: 1) On the admin page for add Place I will put 2 or 3 slots for adding Subplace to a place ... is there a way where the first one would be filled with "defa

Re: Model design

2009-10-23 Thread Léon Dignòn
The second sounds more logically. On 23 Okt., 15:41, chefsmart wrote: > I would go with your second solution. > > On Oct 23, 5:17 pm, Caisys wrote: > > > > > Hi, > > I have classes for Event, Place and Subplace. Some of the Places are > > divided into different Halls (Subplace) and some have on

Re: Model design

2009-10-23 Thread chefsmart
I would go with your second solution. On Oct 23, 5:17 pm, Caisys wrote: > Hi, > I have classes for Event, Place and Subplace. Some of the Places are > divided into different Halls (Subplace) and some have only one. I > would like to know how design the relations between the classes. > > 1) Shoul

Model design

2009-10-23 Thread Caisys
Hi, I have classes for Event, Place and Subplace. Some of the Places are divided into different Halls (Subplace) and some have only one. I would like to know how design the relations between the classes. 1) Should I put two columns in the Event one FK to Place and another FK to Hall? 2) Should I

Re: need help with model design and table relationship

2009-08-10 Thread Unnamed_Hero
Here is the solution. There is no need in Many-to-many here. In people table I've set corp's unique number as a ForeignKey to Corp's table. In a template: {% for i in result %} {% for persons in i.dolgnost_set.all %} {{ person.field1 }} where Dolgnost - a table with people. --~--~-

Re: need help with model design and table relationship

2009-08-04 Thread Malcolm Tredinnick
On Tue, 2009-08-04 at 14:40 -0700, Unnamed_Hero wrote: > > > And you still haven't reduced it to a simple case that fails with a > > specific piece of data at the interactive prompt. You are trying to > > debug through three layers of curtains here. Why not remove the extra > > layers and work di

Re: need help with model design and table relationship

2009-08-04 Thread Unnamed_Hero
> And you still haven't reduced it to a simple case that fails with a > specific piece of data at the interactive prompt. You are trying to > debug through three layers of curtains here. Why not remove the extra > layers and work directly with the ORM to debug an ORM problem, as I > suggested in

Re: need help with model design and table relationship

2009-08-03 Thread Malcolm Tredinnick
On Mon, 2009-08-03 at 08:27 -0700, Unnamed_Hero wrote: [...] > And I still get > Caught an exception while rendering:relation "C12B_boss" doesn't > exist And you still haven't reduced it to a simple case that fails with a specific piece of data at the interactive prompt. You are trying to debug

Re: need help with model design and table relationship

2009-08-03 Thread Unnamed_Hero
And again for your explanations. So I have changed my models as you advise. Also I've made a form from c12b model, and when it displays - I see all peoples from table with people. But I still can't fetch any results Maybe by queryset isn't good. manage.py sql return this: people table: CREAT

Re: need help with model design and table relationship

2009-08-03 Thread Malcolm Tredinnick
On Mon, 2009-08-03 at 03:19 -0700, Unnamed_Hero wrote: > Thanks for your reply. > > And the point is that (forgot to say)... the boss field in c12b table > doesn't exists, it is virtual and exists only in my model. When you add a ManyToManyField to a Django model, it doesn't create a column in t

Re: need help with model design and table relationship

2009-08-03 Thread Unnamed_Hero
Thanks for your reply. And the point is that (forgot to say)... the boss field in c12b table doesn't exists, it is virtual and exists only in my model. I think, this trick can work for me, but I've got (c12b_boss relation does not exist). I thought, that if I point it to a real A22 field (unique

Re: need help with model design and table relationship

2009-08-02 Thread Malcolm Tredinnick
On Sun, 2009-08-02 at 14:08 -0700, Unnamed_Hero wrote: > I have a table with a list of corporations; each corp has a field with > it unique number. > There is a table, filled with people, each record contains a field > with a corp's unique field (where each person works) > > Task: when displaying

need help with model design and table relationship

2009-08-02 Thread Unnamed_Hero
I have a table with a list of corporations; each corp has a field with it unique number. There is a table, filled with people, each record contains a field with a corp's unique field (where each person works) Task: when displaying info about corporation, also fetch info about people working at.

Re: model design issue

2009-03-26 Thread Oli Warner
The true relational way would be to have another Model called JobRunParameter with an FK on Parameter. It's getting a bit silly though and all these look-ups are going to be a pain later on. If Parameter is just a string key/value style thing, I might have simplified things a little and instead of

model design issue

2009-03-26 Thread lify
Hi, I have a model called Job and a model called Parameter. A Job will have several parameters so I have a foreign key in the Parameter class. In my admin I have included Parameter as inline object of Job so when I create a job, I can automatically create parameters for the job. Now I wan

Model design question

2009-03-06 Thread tdelam
Hi Everyone, I recently put a new design to a web site. The web site is static basically aside from some content changes every now and then. The navigation is static, there will never be any addition to this. Each section will have a sub-section though. Also, MAYBE in the future a new sub-section

Re: advice in model design - principally

2009-01-15 Thread _Sebastian_
Hi Bruno, thanks for you search hints, maybe mine (database table layout...) was not the best choice for what I was looking for. I will give it a go again with your suggestions. Thx seb On Jan 16, 1:29 am, bruno desthuilliers wrote: > On 15 jan, 13:05, _Sebastian_ wrote: > > > Hy all, > > >

Re: advice in model design - principally

2009-01-15 Thread bruno desthuilliers
On 15 jan, 13:05, _Sebastian_ wrote: > Hy all, > > I'm trying to replicate a existing project database as a conceptual > test. > > I started off with creating a few models and I thought about ways on > how I could link and/or organise them. As I'm just starting to learn > django and python and my

Re: advice in model design - principally

2009-01-15 Thread Kenneth Gonsalves
On Thursday 15 Jan 2009 6:04:13 pm _Sebastian_ wrote: > Could you elaborate on what you mean with 'then break them a bit for > speed'? well, 3 normal forms is the ideal - but we live in a real world. So after normalising the database, it is often found that repeating a field, or adding a field

Re: advice in model design - principally

2009-01-15 Thread _Sebastian_
Kenneth, thank you for your reply. Could you elaborate on what you mean with 'then break them a bit for speed'? - seb On Jan 15, 11:22 pm, Kenneth Gonsalves wrote: > On Thursday 15 Jan 2009 5:35:56 pm _Sebastian_ wrote: > > > I head a search and came across > >http://publib.boulder.ibm.com/i

Re: advice in model design - principally

2009-01-15 Thread Kenneth Gonsalves
On Thursday 15 Jan 2009 5:35:56 pm _Sebastian_ wrote: > I head a search and came across > http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.i >bm.ddi.doc/ddi27.htm basically you would need to read up on the first three normal forms, try to implement them and then break th

advice in model design - principally

2009-01-15 Thread _Sebastian_
Hy all, I'm trying to replicate a existing project database as a conceptual test. I started off with creating a few models and I thought about ways on how I could link and/or organise them. As I'm just starting to learn django and python and my basic database knowledge is restricted to MS produc

Model design solution

2008-10-24 Thread aiko
I am creating shop, but need advise on model/db design on product part: class Product(models.Model): name = models.CharField(max_length=250) typeid = models.IntegerField() pdata = models.IntegerField() price = ... visible = ... typeid and pdata is for extending product inform

  1   2   >