Re: Django beginner question

2011-08-21 Thread Christian Ramsey
Ok I see.  I like the idea of this I will try it, aha!! I truly understand, 
thank you so much and I will post my outcome!


Christian
On 21 Aug 2011, at 10:17, Gelonida N wrote:

> On 08/21/2011 03:25 AM, Christian Ramsey wrote:
>> Hi and thank you so much,  this provided a ton of clarity, especially
>> the modelling of the order table with a foreign key to a user, I was
>> locked on thinking the user table needed to somehow have the orders
>> within it. But I see I needed to step back.
>> 
>> I've already started to implement all of this and I am trying to
>> understand the  additional table, if the Order table already contains
>> the user it belongs to, then what will the additional table be set
>> for, from my perspective would this be to keep the original order?
>> 
>>> 
>>> I never implemented a shopping application and  what I suggest is very
>>> probably neither the most elegant nor the most efficient solution.
>>> But what is clear is, that you should use at least one table more.
>>> 
>>> Example Suggestion:
>>> 
>>> User: contains info about the user
>>> 
>>> Product: info about a product and it's price (though price might be in a
>>> separate table)
>>> 
>>> Order: Info about the order, which could be ForeignKey to a user, the
>>> order date, and perhaps payment status.
>>> 
>>> And one table more, which would store one entry of a order:
>>> it would store a oeign Key to a Product, the selected amount and a
>>> ForeignKey to the order it belongs to.
>>> 
> 
> My suggestion was, that the Order just contains the customer, the order
> date, and all other data, that is unique for one order,
> but not the items, that have been ordered. tey would be stored in the
> 4th table.
> 
> So the 4th table could be called OrderItem.
> 
> each order item would contain
> - to which order it belongs to (Freign key)
> - what product has been ordered ( foreign key)
> - how many items of the product has been ordered.
> 
> So basically a customer command cosists of all OrderItems belonging to
> one Order.
> 
> As I said before there's many solutions, this is just one.
> 
> 
> 
> -- 
> 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@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django beginner question

2011-08-21 Thread Christian Ramsey
Taking a look at this now!
Cheers.
On 20 Aug 2011, at 19:14, kenneth gonsalves wrote:

> On Sat, 2011-08-20 at 17:03 -0700, Christian Ramsey wrote:
>> Thank you for your response, I was trying to explain it in detail, I
>> believe I get the greater whole of the project which I've specified by
>> explaining the project but the parts I don't I've asked a question
>> about. Maybe my approach is incorrect, I did not mean that my
>> informative parts were suppose to be answered but again merely a poke
>> at trying not to be short, but thank you, I will read the Prepare the
>> question section and see if I can recreate my collection of queries in
>> a refined way in which I hope you and everyone else would consider
>> "industrious" and possibly feel the ability to help rather than to
>> lecture.
> 
> also read something about normal forms, as your question is not so much
> django related as rdbms related. Hint: look at foreign keys.
> -- 
> regards
> Kenneth Gonsalves
> 
> -- 
> 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@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django beginner question

2011-08-21 Thread Gelonida N
On 08/21/2011 03:25 AM, Christian Ramsey wrote:
> Hi and thank you so much,  this provided a ton of clarity, especially
> the modelling of the order table with a foreign key to a user, I was
> locked on thinking the user table needed to somehow have the orders
> within it. But I see I needed to step back.
> 
> I've already started to implement all of this and I am trying to
> understand the  additional table, if the Order table already contains
> the user it belongs to, then what will the additional table be set
> for, from my perspective would this be to keep the original order?
> 
>>
>> I never implemented a shopping application and  what I suggest is very
>> probably neither the most elegant nor the most efficient solution.
>> But what is clear is, that you should use at least one table more.
>>
>> Example Suggestion:
>>
>> User: contains info about the user
>>
>> Product: info about a product and it's price (though price might be in a
>> separate table)
>>
>> Order: Info about the order, which could be ForeignKey to a user, the
>> order date, and perhaps payment status.
>>
>> And one table more, which would store one entry of a order:
>> it would store a oeign Key to a Product, the selected amount and a
>> ForeignKey to the order it belongs to.
>>

My suggestion was, that the Order just contains the customer, the order
date, and all other data, that is unique for one order,
but not the items, that have been ordered. tey would be stored in the
4th table.

So the 4th table could be called OrderItem.

each order item would contain
- to which order it belongs to (Freign key)
- what product has been ordered ( foreign key)
- how many items of the product has been ordered.

So basically a customer command cosists of all OrderItems belonging to
one Order.

As I said before there's many solutions, this is just one.



-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django beginner question

2011-08-20 Thread kenneth gonsalves
On Sat, 2011-08-20 at 17:03 -0700, Christian Ramsey wrote:
> Thank you for your response, I was trying to explain it in detail, I
> believe I get the greater whole of the project which I've specified by
> explaining the project but the parts I don't I've asked a question
> about. Maybe my approach is incorrect, I did not mean that my
> informative parts were suppose to be answered but again merely a poke
> at trying not to be short, but thank you, I will read the Prepare the
> question section and see if I can recreate my collection of queries in
> a refined way in which I hope you and everyone else would consider
> "industrious" and possibly feel the ability to help rather than to
> lecture.

also read something about normal forms, as your question is not so much
django related as rdbms related. Hint: look at foreign keys.
-- 
regards
Kenneth Gonsalves

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django beginner question

2011-08-20 Thread Christian Ramsey
Hi and thank you so much,  this provided a ton of clarity, especially
the modelling of the order table with a foreign key to a user, I was
locked on thinking the user table needed to somehow have the orders
within it. But I see I needed to step back.

I've already started to implement all of this and I am trying to
understand the  additional table, if the Order table already contains
the user it belongs to, then what will the additional table be set
for, from my perspective would this be to keep the original order?

Thanks so much again.

On Aug 20, 6:10 pm, Gelonida N  wrote:
> On 08/21/2011 12:56 AM, Christian Ramsey wrote:
>
>
>
>
>
>
>
>
>
> > Hi I am a Django beginner and I am just getting into creating apps
> > with it, my goal was to create a simple
> > order application for practice. The app will be somewhat like this:
>
> > 1.A user will login or create an account.
> > 2.A user will order from a list of items and depending on the item it
> > may have size and/or type, some will have preset sizes and no type at
> > all.
> > 3. Upon purchase which for this demo will not have a monetary system
> > integrated, so as a replacement it will email the admin email with the
> > details and also display the order to them for printing once they are
> > finished.
> > 4. The user will be able to check his/her orders in which the admin
> > will be able to set to pending or shipped to each order
> > 5. The admin will also be able to view all orders from every user and
> > delete, edit, mark the details of the order.
>
> > Pretty straightforward I thought but I can't seem to wrap my head
> > around the models mostly and especially the product table.
>
> > For the products would I be creating an array of different orders and
> > a separate array of sizes in the controller and assigning that to the
> > form?
>
> > My 3 classes in my model are currently Users, Products, Orders
> > I am not sure how a order from the products is assigned to a user in
> > the database,
> > does the Users class need to have both products and orders inside of
> > it as a one to many for both?
>
> > So when I create the form that submits this information how does it
> > assign that order to that product to that user?
>
> I guess you could already start with the products and the users.
> This is what yuou need in any case and which allows you already to learn
> qutie some django.
> - Create the User and product Models and create either your own views or
> admin views such, that you can populate the Users and Product database.
>
> Then you could work on the view allowing a logged in user to select
> products to be put in the shopping cart.
>
> Only then you had to care about how to implement the shopping cart.
>
> I never implemented a shopping application and  what I suggest is very
> probably neither the most elegant nor the most efficient solution.
> But what is clear is, that you should use at least one table more.
>
> Example Suggestion:
>
> User: contains info about the user
>
> Product: info about a product and it's price (though price might be in a
> separate table)
>
> Order: Info about the order, which could be ForeignKey to a user, the
> order date, and perhaps payment status.
>
> And one table more, which would store one entry of a order:
> it would store a oeign Key to a Product, the selected amount and a
> ForeignKey to the order it belongs to.
>
> Hope this gave you some ideas of how to get started.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django beginner question

2011-08-20 Thread Gelonida N
On 08/21/2011 12:56 AM, Christian Ramsey wrote:
> Hi I am a Django beginner and I am just getting into creating apps
> with it, my goal was to create a simple
> order application for practice. The app will be somewhat like this:
> 
> 1.A user will login or create an account.
> 2.A user will order from a list of items and depending on the item it
> may have size and/or type, some will have preset sizes and no type at
> all.
> 3. Upon purchase which for this demo will not have a monetary system
> integrated, so as a replacement it will email the admin email with the
> details and also display the order to them for printing once they are
> finished.
> 4. The user will be able to check his/her orders in which the admin
> will be able to set to pending or shipped to each order
> 5. The admin will also be able to view all orders from every user and
> delete, edit, mark the details of the order.
> 
> Pretty straightforward I thought but I can't seem to wrap my head
> around the models mostly and especially the product table.
> 
> For the products would I be creating an array of different orders and
> a separate array of sizes in the controller and assigning that to the
> form?
> 
> My 3 classes in my model are currently Users, Products, Orders
> I am not sure how a order from the products is assigned to a user in
> the database,
> does the Users class need to have both products and orders inside of
> it as a one to many for both?
> 
> So when I create the form that submits this information how does it
> assign that order to that product to that user?
> 

I guess you could already start with the products and the users.
This is what yuou need in any case and which allows you already to learn
qutie some django.
- Create the User and product Models and create either your own views or
admin views such, that you can populate the Users and Product database.

Then you could work on the view allowing a logged in user to select
products to be put in the shopping cart.

Only then you had to care about how to implement the shopping cart.

I never implemented a shopping application and  what I suggest is very
probably neither the most elegant nor the most efficient solution.
But what is clear is, that you should use at least one table more.


Example Suggestion:

User: contains info about the user

Product: info about a product and it's price (though price might be in a
separate table)

Order: Info about the order, which could be ForeignKey to a user, the
order date, and perhaps payment status.

And one table more, which would store one entry of a order:
it would store a oeign Key to a Product, the selected amount and a
ForeignKey to the order it belongs to.

Hope this gave you some ideas of how to get started.







-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django beginner question

2011-08-20 Thread Christian Ramsey
Thank you Shawn, 

Thank you for your response, I was trying to explain it in detail, I believe I 
get the greater whole of the project which I've specified by explaining the 
project but the parts I don't I've asked a question about. Maybe my approach is 
incorrect, I did not mean that my informative parts were suppose to be answered 
but again merely a poke at trying not to be short, but thank you, I will read 
the Prepare the question section and see if I can recreate my collection of 
queries in a refined way in which I hope you and everyone else would consider 
"industrious" and possibly feel the ability to help rather than to lecture.

Cheers.
On 20 Aug 2011, at 16:39, Shawn Milochik wrote:

> Christian,
> 
> We understand that you're a beginner, and there are a lot of people that are 
> willing to help people new to Django on this list. However, you've basically 
> laid out an assignment here and asked how to go about it.
> 
> That comes across as asking others to do your work for you. You won't find 
> much assistance when you give the appearance of being either incompetent or 
> lazy, which is how this comes across.
> 
> The best way to learn is by doing, so go start your project. Get as far as 
> you can, and when you have a specific question explain how you got stuck and 
> what you tried to fix it. Then I'm sure you'll get useful replies.
> 
> Please read the "Prepare the question" section here:
> https://code.djangoproject.com/wiki/UsingTheMailingList
> 
> Your initial e-mail violates nearly every tip listed. That list was compiled 
> specifically to allow people who want help to get the most out of this list, 
> and for those who enjoy helping others to avoid wasting their time.
> 
> Shawn
> 
> -- 
> 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@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django beginner question

2011-08-20 Thread Shawn Milochik

Christian,

We understand that you're a beginner, and there are a lot of people that 
are willing to help people new to Django on this list. However, you've 
basically laid out an assignment here and asked how to go about it.


That comes across as asking others to do your work for you. You won't 
find much assistance when you give the appearance of being either 
incompetent or lazy, which is how this comes across.


The best way to learn is by doing, so go start your project. Get as far 
as you can, and when you have a specific question explain how you got 
stuck and what you tried to fix it. Then I'm sure you'll get useful replies.


Please read the "Prepare the question" section here:
https://code.djangoproject.com/wiki/UsingTheMailingList

Your initial e-mail violates nearly every tip listed. That list was 
compiled specifically to allow people who want help to get the most out 
of this list, and for those who enjoy helping others to avoid wasting 
their time.


Shawn

--
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django beginner question

2011-08-20 Thread Christian Ramsey
Hi I am a Django beginner and I am just getting into creating apps
with it, my goal was to create a simple
order application for practice. The app will be somewhat like this:

1.A user will login or create an account.
2.A user will order from a list of items and depending on the item it
may have size and/or type, some will have preset sizes and no type at
all.
3. Upon purchase which for this demo will not have a monetary system
integrated, so as a replacement it will email the admin email with the
details and also display the order to them for printing once they are
finished.
4. The user will be able to check his/her orders in which the admin
will be able to set to pending or shipped to each order
5. The admin will also be able to view all orders from every user and
delete, edit, mark the details of the order.

Pretty straightforward I thought but I can't seem to wrap my head
around the models mostly and especially the product table.

For the products would I be creating an array of different orders and
a separate array of sizes in the controller and assigning that to the
form?

My 3 classes in my model are currently Users, Products, Orders
I am not sure how a order from the products is assigned to a user in
the database,
does the Users class need to have both products and orders inside of
it as a one to many for both?

So when I create the form that submits this information how does it
assign that order to that product to that user?

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.