Sorry for the half response...please ignore the previous message.
class order(models.Model):
order_id = models.IntegerField(unique=True)
customer_id = models.ForeignKey('Customer')
item_id = models.ForeignKey('Item')
qty = models.IntegerField()
This will you give the provision to
Hi
As per my view you can modify your models as follows:-
class order(models.Model):
order_id = models.IntegerField(unique=True)
customer_id = models.ForeignKey('Customer')
item_id = models.ForeignKey('Item')
On Mon, Apr 1, 2013 at 10:30 AM, Lachlan Musicman wrote:
> On 1 April
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
> connect a qty to that. I
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 to Django, as-of-today new
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 t
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,
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 native
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 link
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'}))
class
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 messag
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 = Repor
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
F
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 opt
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
..
>
> 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, sen
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"),
> url(r'^narr
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+)/$',
'
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', name="narrow_
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 s
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 th
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:
> > c.
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 a
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 by
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
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 gro
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 Goo
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 os
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 examp
28 matches
Mail list logo