> I am designing a database for a django project. I already read this
> tutorial that I found really useful:
> https://learndjango.com/tutorials/database-design-tutorial-beginners
>
> I have a question regarding the normalization. The normalization is
> important due that we need to reduc
I am designing a database for a django project. I already read this tutorial
that I found really useful:
https://learndjango.com/tutorials/database-design-tutorial-beginners
I have a question regarding the normalization. The normalization is important
due that we need to reduce redundant data
The best approach is for the Django/DB devs to create these fields (and
forms) in advance for the users to enter data.
If you want users to add "key/pair" type data which is not known in
advance, look to adding a JSON column to your table; see:
https://www.postgresql.org/docs/14/datatype-json.ht
Ohh you want create custom fields in forms
Take input, select, textarea tags, make them their own fields but save all
of these in fields in one table with types and max values all of the
attributes of tags
Finally show then what they chosen
On Sun, 23 Jan 2022 at 2:28 PM, Prashanth Patelc
wro
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 field
That looks like a database error - check in your database as to which
tables have been created.
On Thursday, 28 August 2014 18:05:01 UTC+2, Jason G wrote:
>
> Ok - here is where I am stuck now. Any thoughts?
>
> If I try to render {{ vessel.CurrentBrew }} in a view, I get something
> like this:
Ok - here is where I am stuck now. Any thoughts?
If I try to render {{ vessel.CurrentBrew }} in a view, I get something like
this:
and this errors out:
{% for Brew in vessel.CurrentBrew.all %}X{{ Brew.ActualName }}{%
endfor %}
(1146, "Table 'dbLunawireBrewing.brewlog_vessel_CurrentBrew' does
Hi Gerald - thanks for the quick reply! Turns out it was just an issue with
quotes...not sure I am doing it right just yet, but at least I've passed
the error.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group
their order if I am understanding you right does not effect this, the last
part is just a join between the tables, you don't have to create another
table
On Thu, Aug 28, 2014 at 8:46 AM, Jason G wrote:
> Hi all,
>
> I am building an app to track my home brewing.
>
> I have two tables, one for
Hi all,
I am building an app to track my home brewing.
I have two tables, one for vessels, and another for brews.
I want the Brew table to have a pick-list, relation to Vessels so I can say
what vessel the brew is in.
I also want to render a table that shows all Vessels and what Brew is in
ea
I would make the imports model an "intermediate model" - see here:
https://docs.djangoproject.com/en/1.6/topics/db/models/#extra-fields-on-many-to-many-relationships
L.
On 16 March 2014 09:41, willy Hakizimana wrote:
> Thank you guys so much. You guys rock!
>
>
> On Saturday, March 15, 2014 10:
Thank you guys so much. You guys rock!
On Saturday, March 15, 2014 10:38:03 AM UTC-5, willy Hakizimana wrote:
>
> First of all, this community is amazing at how fast questions are
> answered. I have learned so much.
>
>
> I am designing an app with models that look like this.
>
> Country(country_
Actually, the Django term for this is "through". Not via.
See
https://docs.djangoproject.com/en/1.6/topics/db/models/#extra-fields-on-many-to-many-relationships
on how to specify the intermediate table to be used in many-to-many
relationships.
Den lördagen den 15:e mars 2014 kl. 18:01:02 UTC
On Sat, Mar 15, 2014 at 9:38 AM, willy Hakizimana wrote:
> First of all, this community is amazing at how fast questions are answered.
> I have learned so much.
>
>
> I am designing an app with models that look like this.
>
> Country(country_id(PK), country_name, gdp, gdp_growth, income_per_capita
First of all, this community is amazing at how fast questions are answered.
I have learned so much.
I am designing an app with models that look like this.
Country(country_id(PK), country_name, gdp, gdp_growth, income_per_capita)
Product(product_id(PK), product_name, country_id(FK), imports_vol
On Thu, Jul 21, 2011 at 5:35 PM, Marc Aymerich wrote:
>
> ups, I think it should be:
> contract.products.filter(id=Y).values_list('rebate_pct', flat=True)
> product.contractproduct_set.filter(id=X).values_list('rebate_pct',
> flat=True)
Thanks. The first one does not work since rebate_pct is in t
On Thu, Jul 21, 2011 at 11:33 PM, Marc Aymerich wrote:
>
>
> On Thu, Jul 21, 2011 at 11:11 PM, nixlists wrote:
>
>> On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote:
>> > ContractProduct.objects.all()
>> > Following might work also (not sure, but is easy to test in shell for
>> > example):
>
On Thu, Jul 21, 2011 at 11:11 PM, nixlists wrote:
> On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote:
> > ContractProduct.objects.all()
> > Following might work also (not sure, but is easy to test in shell for
> > example):
> > for c in Contract.objects.all():
> > for cp in c.contractprod
On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote:
> ContractProduct.objects.all()
> Following might work also (not sure, but is easy to test in shell for
> example):
> for c in Contract.objects.all():
> for cp in c.contractproduct_set.all():
> print c, cp.product, cp.rebate_pct
> --
On Thu, Jul 21, 2011 at 10:50 PM, nixlists wrote:
> On Thu, Jul 21, 2011 at 2:17 PM, Jani Tiainen wrote:
> > Hi,
> > So you want to tie Contract with Product(s) with rebate_pct? You then
> need
> > custom intermediary m2m table say "ContractProduct"
> > https://docs.djangoproject.com/en/1.3/top
On Thu, Jul 21, 2011 at 2:17 PM, Jani Tiainen wrote:
> Hi,
> So you want to tie Contract with Product(s) with rebate_pct? You then need
> custom intermediary m2m table say "ContractProduct"
> https://docs.djangoproject.com/en/1.3/topics/db/models/#intermediary-manytomany>
> for more. So in the end
Hi,
So you want to tie Contract with Product(s) with rebate_pct? You then need
custom intermediary m2m table say "ContractProduct" https://docs.djangoproject.com/en/1.3/topics/db/models/#intermediary-manytomany>
for more. So in the end your models would probably look a alike following:
class Cont
Sorry about formatting. Also the there is a mistake.
"I'd like to define the Product model..." should be
"I'd like to define the Contract model...
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dja
Hi. I have a question about writing normalized models. I began writing
an app that has non-normalized tables, and would like to rewrite it
with a normalized design.
I have non-normalized legacy tables like this without foreign keys or
many-to-many relationships, which I would like to have.
Contra
The sample type table is only needed to generate a form for new samples.
> > The attribute table could be broken up by data type if necessary as well.
>
> > Sent from my Verizon Wireless BlackBerry
>
> > -Original Message-
> > From: llanitedave
> > Da
t;
> Sent from my Verizon Wireless BlackBerry
>
> -Original Message-
> From: llanitedave
> Date: Fri, 18 Jun 2010 23:27:55
> To: Django users
> Subject: Re: Database Design Question
>
> Thanks for the response, Venkatraman. You're right that I don't
> ant
Sent from my Verizon Wireless BlackBerry
-Original Message-
From: llanitedave
Date: Fri, 18 Jun 2010 23:27:55
To: Django users
Subject: Re: Database Design Question
Thanks for the response, Venkatraman. You're right that I don't
anticipate a huge number of records here -- a few
Hallöchen!
llanitedave writes:
> [...]
>
> I guess it's mostly a normalization question.
>
> And while I was typing out a long explanatory discussion to
> enlarge on the problem, I stumbled across the answer.
>
> I'll need to use a separate table for each sample type to store
> its unique set of
Thanks for the response, Venkatraman. You're right that I don't
anticipate a huge number of records here -- a few hundred thousand at
the extreme high end. Sharding isn't something I considered, and I
don't think it would be necessary.
I guess it's mostly a normalization question.
And while I w
On Sat, Jun 19, 2010 at 10:12 AM, Venkatraman S wrote:
> Prefer a table like follows (tblname:samples): sampleid, samplename ,
> sampledesc etc etc
>
Ok - i missed explaining why i would recommend this:
In most of the applications, maintainence is a bigger pain than development.
In your case,
On Sat, Jun 19, 2010 at 4:28 AM, llanitedave wrote:
> I'm putting together a system to track scientific samples of various
> types. The "various types" is what's making me scratch my head at the
> moment.
>
Prefer a table like follows (tblname:samples): sampleid, samplename ,
sampledesc etc e
I'm putting together a system to track scientific samples of various
types. The "various types" is what's making me scratch my head at the
moment.
Each sample type has a particular set of attributes, some of which are
unique, others are shared with other sample types.
For example, a fluid sample
mart wrote:
>
> On Sep 30, 2009, at 4:17 PM, Thomas Guettler wrote:
>
>> In OrderDetail you have a ForeignKey to Product. But you need to
>> *copy*
>> the price. Example: if someone orders something at day1 for 1 dollar,
>> and you set the price on day2 to 3 dollar, you need to ship your
>>
On Sep 30, 2009, at 4:17 PM, Thomas Guettler wrote:
>
> In OrderDetail you have a ForeignKey to Product. But you need to
> *copy*
> the price. Example: if someone orders something at day1 for 1 dollar,
> and you set the price on day2 to 3 dollar, you need to ship your
> product cheap for all w
In OrderDetail you have a ForeignKey to Product. But you need to *copy*
the price. Example: if someone orders something at day1 for 1 dollar,
and you set the price on day2 to 3 dollar, you need to ship your
product cheap for all who odered before day2.
max kalinski wrote:
> hi djangos,
>
> i swi
On Sep 30, 2009, at 1:54 PM, Tim Chase wrote:
>
>> products_ordered = models.ManyToManyField(Product)
>>
>> i don't like it (as i would have to create my own "through" table/
>> class)
>> for saving the recent price, qty, date etc.
>
> I'm not sure what your complaint about the "through" table i
> products_ordered = models.ManyToManyField(Product)
>
> i don't like it (as i would have to create my own "through" table/
> class)
> for saving the recent price, qty, date etc.
I'm not sure what your complaint about the "through" table is --
is it that you'd have to create it (which you do be
hi djangos,
i switched from symfony to django :)
its fun, thanks!
but i am stuck with my database/model design.
now it gets OT (sorry)
but i need an opinion on how to design
a typical order process:
class Order(models.Model):
user = models.ForeignKey(User, verbose_name=_("Customer"),
relat
Hi all,
First, congrats on the release of 1.1, real exciting!
Second, I'm working on a web site that basically allows athletes to register
on it with the goal of tracking their game stats. So, for example, if an
athlete plays baseball, he can track specific stats such as number of home
runs, doubl
Validation turns out to be well-nigh impossible using parent / child
aliases, but pretty easy with parent / child accounts. Here's what
I've ended up with:
class Account(models.Model):
user = models.ForeignKey(User, unique=True, null=True, blank=True)
alias = models.CharField(ma
I'm not asking as a Django / foreign key thing. I'm having a lot of
trouble referencing each model from the other's save method for
validation purposes, because there's always going to be one that's
declared after the other.
On Aug 19, 10:35 am, Joshua Russo wrote:
> You can, it just creates
You can, it just creates headaches. At least one of the ForeignKeys needs to
not be required (I believe that's the default anyway).
On Wed, Aug 19, 2009 at 1:27 PM, ringemup wrote:
>
>
> Is having two classes that reference one another just simply something
> that can't be done in Python?
>
>
>
Is having two classes that reference one another just simply something
that can't be done in Python?
On Aug 19, 4:36 am, Joshua Russo wrote:
> On Tue, Aug 18, 2009 at 11:04 PM, ringemup wrote:
>
> > Well, I'm trying to implement parent / child aliases, but I'm running
> > into problems with
On Tue, Aug 18, 2009 at 11:04 PM, ringemup wrote:
>
> Well, I'm trying to implement parent / child aliases, but I'm running
> into problems with class declaration order because I need to reference
> the Alias class from within the Account class as well as referencing
> Account from Alias for valid
liases and add them to it).
> > > > Additionally, enforcing a limit on the number of aliases is
> > > > problematic. Finally, even if you do enforce these constraints
> > > > programmatically, it doesn't seem to be feasible to relay error
> >
do enforce these constraints
> programmatically, it doesn't seem to be feasible to relay error
> messages to contrib.admin.
>
> Has anyone else encountered this design problem, and how did you go
> about addressing it?
>
I have experienced this situation a couple of times and I
and then create aliases and add them to it).
> > > Additionally, enforcing a limit on the number of aliases is
> > > problematic. Finally, even if you do enforce these constraints
> > > programmatically, it doesn't seem to be feasible to relay error
> > > mes
design problem, and how did you go
> > about addressing it?
>
> I have experienced this situation a couple of times and I would recommend
> the second option you discussed. Circular referenced like your first option
> can become very problematic and are not recommended
I have accounts that can have multiple aliases, but each account must
have a primary alias. I can think of two ways to institute this, but
they both have problems:
1) reference the primary alias from the account:
class Account(models.Model):
...
primary_alias = models.OneToOneField('Alias',
Hi,
A very simple database design. Please suggest/validate.
Requirements:
Objects -
a. User
b. Categories
c. Tags
* User creates categories
* Tags are saved in categories by user
* User and Categories have many -to-many relationship
* Tags and categories have many-to-many relationship
* User
Hi Doug,
On 4/26/07, Doug Van Horn <[EMAIL PROTECTED]> wrote:
> [Links]
> There's no harm in having unique columns in addition to your primary
> key (as you describe). The nut of the problem around natural keys,
> IMHO, is that the rules that make them natural keys today can change
> such that t
On Apr 25, 3:16 pm, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
>
> I'm a bit confused on how do it 'right(tm)'. Is there a
> rule or how would you do it?
>
You're asking about surrogate and natural keys:
http://en.wikipedia.org/wiki/Surrogate_key
http://en.wikipedia.org/wiki/Natural_key
Why not do both. I've always preferred letting the database generate
an auto primary key (id in django) even if my usage is primarily a
different column for key. Storing an int isn't wasting much space,
what do you have to lose? I've got a users object for example that
requires a unique email
A point that I missed was the speed. Is method 1) maybe faster than method 2?
I think it could.. because in 1) there are only numbers stored as
primary_key and
not strings (which can be as long as 255 characters).
Speed is one thing.. but is there any other difference between the two methods?
Whi
Hi,
On 4/25/07, Mike Caldwell <[EMAIL PROTECTED]> wrote:
> I don't think there is a "right(tm)" way, but there are some things to
> consider. A lot of people would argue that a unique characteristic makes a
> very good primary key, I think I might be one of them. But, remember that
> data refle
25/07, Kai Kuehne <[EMAIL PROTECTED]> wrote:
>
>
> Hello list,
> I have a question regarding general database design.
> Ok.. which method would you recommend, if you have a table
> with a field 'name' which values should be unique in the whole table?
>
> 1) use (
Mike Caldwell wrote:
> That is why governments invent things like SSN, to make you unique.
btw, don't use SSN as unique id 8)
Besides security and privacy issues, it's also not guaranteed to be
unique. At a previous job dealing w/ cell phone accounts, it was
possible for the same person to h
Hello list,
I have a question regarding general database design.
Ok.. which method would you recommend, if you have a table
with a field 'name' which values should be unique in the whole table?
1) use (implicit) id which is automatically added by django, as primary
key and a 'n
Thanks for all of the suggestions. I will be checking those out.
On Nov 15, 2:25 am, Carl Holm <[EMAIL PROTECTED]> wrote:
> Another good read on the subject...
>
> Title: Database in Depth
> Subtitle: Relational Theory for Practitioners
> First Edition: May 2005
> Series: Theory In Practice
> ISB
Another good read on the subject...
Title: Database in Depth
Subtitle: Relational Theory for Practitioners
First Edition: May 2005
Series: Theory In Practice
ISBN: 0-596-10012-4
Pages: 228
- available from O'reilly
Eric Lake wrote:
> I think that I am really starting to understand how django wo
Data Modeling Essentials
by Graeme Simsion, Graham Witt
http://preview.tinyurl.com/yy6vlc
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@goo
(which is a key principle of good database
design):
http://www.bkent.net/Doc/simple5.htm
--
"May the forces of evil become confused on the way to your house."
-- George Carlin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Hello Eric,
On Tue, Nov 14, 2006 at 11:37:47AM -0500, Eric Lake wrote:
> I think that I am really starting to understand how django works. The area
> that I am not very good at is designing the database model. Can you
> recommend a good tutorial or book that gets into how create logical,
> elegan
I think that I am really starting to understand how django works. The area that I am not very good at is designing the database model. Can you recommend a good tutorial or book that gets into how create logical, elegant, efficient databases. It doesn't have to be specific to one type (MySQL, Postgr
On Aug 5, 2006, at 9:26 PM, Rob Hudson wrote:
>
> Thanks everyone for the replies. I tried CocoaMySQL but will have to
> try the others. MySQL Workbench looks promising since it can give you
> a diagram of your schema. I'll have to play with some of the
> diagraming tools mentioned. Apprecia
Thanks everyone for the replies. I tried CocoaMySQL but will have to
try the others. MySQL Workbench looks promising since it can give you
a diagram of your schema. I'll have to play with some of the
diagraming tools mentioned. Appreciate all the feedback.
-Rob
--~--~-~--~~-
I am using Eclipse with PyDev and Quantum. It is a nice IDE. Gen On Aug 5, 2006, at 3:44 PM, [EMAIL PROTECTED] wrote:& that should have also said that while MySQL Workbench is flaky ( asyou've found out ), I haven't had any problems with MySQL admin.There's also YourSQL which is quite nice (http://
& that should have also said that while MySQL Workbench is flaky ( as
you've found out ), I haven't had any problems with MySQL admin.
There's also YourSQL which is quite nice (http://yoursql.ludit.it/)
--Simon
--~--~-~--~~~---~--~~
You received this message bec
As an alternative to cocoamysql, MySQL provides its admin tools like
MySQL Workbench, MySQL Administrator (this is very nice) for OS X here:
http://dev.mysql.com/downloads/gui-tools/5.0.html
(free as in beer)
As for the Django Model -> dot converter, that sound fun. I'll give it
a go when I get
On 05/08/2006, at 3:07 AM, John Melesky wrote: If you could point to the specific screencasts, that would makeidentifying the tool easier.At a guess, though, CocoaMySQL is a likely candidate. Even if it's notwhat they're using, it's useful for the things you list:http://cocoamysql.sourceforge.net/C
I use YourSQL - http://yoursql.ludit.it/On 8/4/06, Rob Hudson <
[EMAIL PROTECTED]> wrote:I've seen some screencasts of various web frameworks (rails,
turbogears) where the user has a nice interface to a mysql admin toolfor creating tables, running queries, etc on a Mac. I can't find areference any
On 4 Aug 2006, at 19:35, Joseph Heck wrote:
> I believe it was a little custom script that generated a schema
> model in OmniGraffle from the ruby code. Not 100% sure, but I
> recall seeing one of the local ruby guys using it.
Back in April I posted here:
Subject: pictorial representation
On 4 Aug 2006, at 19:35, Joseph Heck wrote:
> I believe it was a little custom script that generated a schema
> model in OmniGraffle from the ruby code. Not 100% sure, but I
> recall seeing one of the local ruby guys using it.
It’s probably off-topic and orthogonal to the MySQL modeling tool
On Aug 4, 2006, at 11:40 AM, Rob Hudson wrote:
> I've seen some screencasts of various web frameworks (rails,
> turbogears) where the user has a nice interface to a mysql admin tool
> for creating tables, running queries, etc on a Mac. I can't find a
> reference anywhere to what this might be. I
I believe it was a little custom script that generated a schema model in OmniGraffle from the ruby code. Not 100% sure, but I recall seeing one of the local ruby guys using it.I think this is what you're talking about:
http://graffletopia.com/stencils/56-joeOn 8/4/06, John Melesky <
[EMAIL PROTECT
Rob Hudson wrote:
> I've seen some screencasts of various web frameworks (rails,
> turbogears) where the user has a nice interface to a mysql admin tool
> for creating tables, running queries, etc on a Mac. I can't find a
> reference anywhere to what this might be. I downloaded and tried MySQL
>
On Aug 4, 2006, at 9:44 AM, [EMAIL PROTECTED] wrote:
>
> Rob Hudson wrote:
>> I've seen some screencasts of various web frameworks (rails,
>> turbogears) where the user has a nice interface to a mysql admin tool
>> for creating tables, running queries, etc on a Mac. I can't find a
>> reference a
I've seen some screencasts of various web frameworks (rails,
turbogears) where the user has a nice interface to a mysql admin tool
for creating tables, running queries, etc on a Mac. I can't find a
reference anywhere to what this might be. I downloaded and tried MySQL
Workbench but it was very s
Rob Hudson wrote:
> I've seen some screencasts of various web frameworks (rails,
> turbogears) where the user has a nice interface to a mysql admin tool
> for creating tables, running queries, etc on a Mac. I can't find a
> reference anywhere to what this might be. I downloaded and tried MySQL
79 matches
Mail list logo