Re: Data Structure - Orders and multiple items

2013-03-31 Thread Lachlan Musicman
On 1 April 2013 15:07, Eric Lovrien wrote: > I am not sure of how or the best way to structure my data in models.py. I > would like to have an order and allow multiple items / products to be added > to an order. I know I can do a ManyToMany field but not sure how I would >

Re: Hey! I'm recieving an index error when trying to import models, and I can't figure out why.

2013-03-31 Thread Jonathan Baker
When importing Python modules, you don't need to include the '.py' file extension. So, from models.py import UUID ...needs to be: from models import UUID Hope this helps, Jonathan On Sun, Mar 31, 2013 at 10:27 PM, C Alaric Moore wrote: > Hello, > > I am incredibly new

Hey! I'm recieving an index error when trying to import models, and I can't figure out why.

2013-03-31 Thread C Alaric Moore
Hello, I am incredibly new to Django, as-of-today new, so forgive me if I've missed something really obvious. I've been going through the tutorial and did so mostly-successfully and decided to redo it with my own code. Everything was going fine until I decided that it would be a good idea

Data Structure - Orders and multiple items

2013-03-31 Thread Eric Lovrien
I am not sure of how or the best way to structure my data in models.py. I would like to have an order and allow multiple items / products to be added to an order. I know I can do a ManyToMany field but not sure how I would connect a qty to that. I am sure there is some simple way of doing this,

Re: how do I specify optional params in url?

2013-03-31 Thread frocco
Ok, I understand and will try and provide more detail in the future. Thanks again On Sunday, March 31, 2013 5:28:54 PM UTC-4, Alexis Roda wrote: > > Al 31/03/13 22:43, En/na frocco ha escrit: > > Thank you for taking the time to help me. > > You're welcome. > > One last thing. I'm not a

Re: Using Django docs to find widget readonly specification

2013-03-31 Thread Alexis Roda
Al 31/03/13 23:42, En/na AJP ha escrit: I'm new to learning Django. I want to find the documentation regarding the readonly attribute you can set for admin widgets. Do you mean? https://docs.djangoproject.com/en/1.5/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields It's

Using Django docs to find widget readonly specification

2013-03-31 Thread AJP
I'm new to learning Django. I want to find the documentation regarding the readonly attribute you can set for admin widgets. For example, from an admin.py: class SourceForm(forms.ModelForm): data = forms.CharField(widget=TextInput(attrs={'readonly': True, 'class': 'averageField'}))

Re: how do I specify optional params in url?

2013-03-31 Thread Alexis Roda
Al 31/03/13 22:43, En/na frocco ha escrit: Thank you for taking the time to help me. You're welcome. One last thing. I'm not a native english speaker, so if I sound rude it's not my intention. That said ... When you ask for help in the list try to include more information: the error

(1242, 'Subquery returns more than 1 row')

2013-03-31 Thread Satinderpal Singh
I have the following error in my project (1242, 'Subquery returns more than 1 row') my views are as given below def result_cube(request): Id = Cube.objects.aggregate(Max('Report_id')) ID = Id['Report_id__max'] cubee = Cube.objects.filter(Report_id = ID) Id =

Re: I get import errors when I run django-admin.py startproject in Windows

2013-03-31 Thread Brek Cooney
Thanks for your help Karen. I enter python C:\python33\scripts\django-admin.py startproject mysite The response I get is Traceback (most recent call last): File "C:\Python33\lib\site-packages\django\core\management\templates.py", line 12, in from urllib.request import urlretrieve

Re: how do I specify optional params in url?

2013-03-31 Thread frocco
Thank you for taking the time to help me. On Sunday, March 31, 2013 1:00:24 PM UTC-4, frocco wrote: > > Hello, > > Here is my current url. > >url(r'^narrow_category/(\d+)/(\w*)/(\d*)/(\d*)/(\d*)/$', > 'catalog.views.narrow_category', name="narrow_category"), > > d+ is required > w* can be

Re: how do I specify optional params in url?

2013-03-31 Thread Alexis Roda
Al 31/03/13 21:55, En/na frocco ha escrit: I am kinda lost with url encoding being a newbie in django. I do not see my error. Can you give me an example? Here it is: views.py: def my_view(request, foo, bar="spam"): pass urls.py # choose descriptive names for the views

Re: how do I specify optional params in url?

2013-03-31 Thread frocco
> > I am kinda lost with url encoding being a newbie in django. I do not see my error. Can you give me an example? Thanks -- 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,

Re: how do I specify optional params in url?

2013-03-31 Thread Alexis Roda
El diumenge 31 de març de 2013 21:01:55 UTC+2, frocco va escriure: > > url(r'^narrow_category/(\d+)/$', 'catalog.views.narrow_category', > name="narrow_category"), > url(r'^narrow_category/(\d+)/(\w+)/$', > 'catalog.views.narrow_category', name="narrow_category"), >

Re: how do I specify optional params in url?

2013-03-31 Thread Alexis Roda
Al 31/03/13 21:01, En/na frocco ha escrit: url(r'^narrow_category/(\d+)/$', 'catalog.views.narrow_category', name="narrow_category"), url(r'^narrow_category/(\d+)/(\w+)/$', 'catalog.views.narrow_category', name="narrow_category"), url(r'^narrow_category/(\d+)/(\w+)/(\d+)/$',

Re: how do I specify optional params in url?

2013-03-31 Thread frocco
url(r'^narrow_category/(\d+)/$', 'catalog.views.narrow_category', name="narrow_category"), url(r'^narrow_category/(\d+)/(\w+)/$', 'catalog.views.narrow_category', name="narrow_category"), url(r'^narrow_category/(\d+)/(\w+)/(\d+)/$', 'catalog.views.narrow_category',

Re: how do I specify optional params in url?

2013-03-31 Thread Alexis Roda
Al 31/03/13 19:00, En/na frocco ha escrit: Hello, Here is my current url. url(r'^narrow_category/(\d+)/(\w*)/(\d*)/(\d*)/(\d*)/$', 'catalog.views.narrow_category', name="narrow_category"), d+ is required w* can be optional last three d* can be optional This setting is not working. You

how do I specify optional params in url?

2013-03-31 Thread frocco
Hello, Here is my current url. url(r'^narrow_category/(\d+)/(\w*)/(\d*)/(\d*)/(\d*)/$', 'catalog.views.narrow_category', name="narrow_category"), d+ is required w* can be optional last three d* can be optional This setting is not working. What am I doing wrong? Thanks -- You received

Re: How do I get these field values in my template?

2013-03-31 Thread frocco
Thank you On Sunday, March 31, 2013 10:17:35 AM UTC-4, Alexis Roda wrote: > > Al 31/03/13 15:18, En/na frocco ha escrit: > > cat = Product.objects.values_list('category__image_path','category__id') > > > > outputs; > > (u'category/goodyear logo.jpg', 13) > > > > I tried for c in cat: > >

Re: Filtering M2M in Admin Interface

2013-03-31 Thread Tim Cook
Answering myself, but for future searchers. This is related to this bug report https://code.djangoproject.com/ticket/14891 as well as this discussion http://goo.gl/ac5lg So for now I'll figure out a work around with QuerySets and indexes, instead of using keys. Cheers, Tim On Sat, Mar 30, 2013

Re: How do I get these field values in my template?

2013-03-31 Thread Alexis Roda
Al 31/03/13 15:18, En/na frocco ha escrit: cat = Product.objects.values_list('category__image_path','category__id') outputs; (u'category/goodyear logo.jpg', 13) I tried for c in cat: c.image_path c.id As its name may suggest values_lists() returns (kind) a list of lists, so you must index

Re: I get import errors when I run django-admin.py startproject in Windows

2013-03-31 Thread Karen Tracey
What errors, exactly? Without some specifics of what's going wrong it's hard to offer help. Copy/paste of exactly what you are entering and getting in response would help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

How do I get these field values in my template?

2013-03-31 Thread frocco
cat = Product.objects.values_list('category__image_path','category__id') outputs; (u'category/goodyear logo.jpg', 13) I tried for c in cat: c.image_path c.id Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

I get import errors when I run django-admin.py startproject in Windows

2013-03-31 Thread Brek Cooney
I get import errors when I run django-admin.py startproject for the first time in Windows 7. I installed Django 1.5.1 and I am trying to use that with Python 3.3. Any ideas about how to get past this hurdle? I am new to Django. -- You received this message because you are subscribed to the

my project is not working in virtualenv in ubuntu?

2013-03-31 Thread Avnesh Shakya
hi, please tell me,what is issue with me, I am using virtualenv in ubuntu, i am fine in window,but here it's not showing admin pages, I have installed apache2 and wsgi, i want to run my project through my own apache2.but its not showing my pages- /var/www/mydomain.com/index.py import

Re: Question about documentauion under Managers>Adding extra Manager methods

2013-03-31 Thread Russell Keith-Magee
Unless I'm mistaken, it's PostgreSQL. The telling feature is the GROUP BY clause - PostgreSQL allows you to group by column index. http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-GROUPBY Since this is an eccentricity of PostgreSQL, it would be a good idea for us to modify that