#x27;s the correct way if you use ordering on another column.
self.filter(town_name__istartswith='Randfo').values('town_name').distinct().order_by()
- this works as I would have expected 'cos it drops the SQL ORDER BY.
So it would be nice to do this:
self.filter(town_name_
{% for Ltarp in smth.3 %}
SHOULD BE
{% for Ltarp in smth.2 %}
'cos Lans only has 3 elements and Ltarp is Lans[2].
Chris
-Original Message-
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On
Behalf Of gintare
Sent: 07 January 2011 08:52
To: Django users
Sub
Not sure if http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/
will be of some help. See admin.site.disable_action('delete_selected')
; but this is only via the admin app. You could build some logic in the model
by overriding the save() method, conditionally, based upon user. So your
Have a look at unique_together:
Django | Model Meta options | Django documentation
http://docs.djangoproject.com/en/dev/ref/models/options/
Jump to unique_together‎: Options.unique_together¶. Sets of field names that,
... For convenience, unique_together can be a single list when dealing ...
docs
1) Generally "not a valid archive" means the file was corrupted during the
download/copy or the download/copy did not complete. If you used ftp to copy
the file and the file mode settings was ASCII (not binary) then you can have a
corrupt file (because CR 0x0D gets converted to CRLF 0x0D0A). If
The "save def save(self, *args, **kwargs):" should not have the leading save.
Also, if you are making a car system then this structure seems more appropriate:
class CarMake(models.Model):
...
class Car(models.Model):
make = models.ForeignKey(CarMaker)
...
def save(self, *args, **kwargs
change
href='{{ MEDIA_URL }}/static/PageStyle.css' />
to
href='{{ MEDIA_URL }}static/PageStyle.css' />
-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of octopusgrabbus
Sent: 29 January 2011 21:17
To: Django users
Subject: Re: Django
Hi Ivo,
SQL is like regular expressions. You can go complex (with one mega
query/expression) but it could create a maintenance nightmare. See if you
cannot simplify the query into multiple queries and a bit of code (for loops
and using the joining columns) to lash them together. The code sequen
Hi Sushanth,
I am currently working through the book "Django JavaScript Integration: AJAX
and jQuery" by Jonathan Hayward. In Chapter 7 he covers autocomplete (see
http://jqueryui.com/ or more specifically
http://jqueryui.com/demos/autocomplete/) to handle filtered drop down.
From: django-use
Hi Marco,
Again the book "Django JavaScript Integration: AJAX and jQuery" by Jonathan
Hayward. In Chapter 6 he covers jQuery In-place editing by using
http://www.appelsiini.net/projects/jeditable
PS: I have never met Jonathan, I live far-away in Africa, so I am not plugging
his book. I happen
)
nmatches = nmatches + 1
Insert (de-dented once, same as for line 148):
#_Start Chris Matthews
10 May 2005
self.grouplist.insert(END, "Named Groups:")
GroupDict = m.groupdict()
Hi Dean,
Looks like you pass the class ContractForm in to your render (and not the
variable contractForm). Also on naming (PEP 8) contract_form would have been
nicer for the variable (and would have stood out more so that the error was
easier to spot).
Regards
Chris
-Original Messa
Hi Sithembewena,
If you want to monitor changes to tables then you might also be interested in
keeping audit/history records. See the book ProJango by Marty Alchin Chapter 11
(page 263 onwards) and http://qr7.com/2010/10/django-simple-history-ftw/ by
Corey Bertram
Regards
Chris
From: django-
Hi Hank,
I just got the book "jQuery UI 1.7" by Dan Wellman. Chapter 8 covers
Progressbar. Have not worked through it yet so I can't give my view on it.
Regards
Chris
-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of hank23
Sent:
Hi Galago,
For some conventions see
http://docs.djangoproject.com/en/dev/internals/contributing/?from=olddocs#django-conventions
and http://www.python.org/dev/peps/pep-0008/
Generally I do imports at the top of the module in this order (with a blank
line inbetween):
1. python modules
2.
Hi Patrick,
You can typically get it by:
1)missing the % for a string format:
x = "Hello number %d" (5)
TypeError: 'str' object is not callable
2) And if you overwrite a function name with a string, e.g."
>>> min(5,2,3)
2
>>> hour,min,sec = "14:59:03".split(":")
>>> m
Hi Bobby,
See
http://adil.2scomplement.com/2008/05/django-add-choices-to-form-fields-on-runtime/
Try something like the following:
# Define your choices
LOCATION_CHOICES = ((1,'location1'),
(2,'location2'),
(3,'location3'),
(4,'locatio
Hi Serek,
Try this
def doMagic(self):
date = '2010-05-04'
#//here I need to take 10 conencted Bbb objects whcich data is less
then date
previous10days = Bbb.objects.filter(date__lt=date).order_by('data')
Also read up about managers
http://docs.djangoproject.c
Hi Matteius,
You must set blank=True in the model so that the form can be returned to you
with those fields empty and then you fill it in the save().
pub_date = models.DateTimeField(blank=True)
author = models.ForeignKey(User, blank=True, verbose_name='Author')
Also read up on editable=
Hi Balu,
Numeric data from the form must be converted to int. I suspect you wanted to
index data; not id_list.
if request.method=="POST":
data = request.POST
temp_list = data.keys()
id_list = []
for i in temp_list:
id_list.append(id_li
Oh and you probably wanted:
if request.method=="POST":
data = request.POST
id_list = [int(x) for x in data.values()]
questions = MyModel.objects.filter(id__in = id_list)
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behal
you Chris Matthews for your reply.
I'm working on a online examination system. I could able to generate
some random questions from a data base containg hundreds of questions.
So when ever a user answer and submit those random questions a
dictionary contating a "Question_id and Answer&quo
It also seems that the space preceding the caret ^ should not be there
So
^blog/ ^(?P\d{4})/$
Should be
^blog/^(?P\d{4})/$
-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of jnns
Sent: 20 February 2011 03:07
To: Django users
(r'^(?P\d{4})/(?P\[a-z]{3})/(?P\w{1,2})/
$','archive_day',dict(info_dict,template_name='blog/list.html')),
(r'^(?P\d{4})/(?P\[a-z]{3})/$','archive_month',
dict(info_dict, template_name='blog/list.html')),
(r&
Typo
choices.append((item.name, item.name))
should be
choices.append((item.id, item.name))
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Mike Ramirez
Sent: 24 February 2011 14:10
To: django-users@googlegroups.com
Subject: Re: field choices() as queryset?
Hi Andre,
Also have a look at:
http://code.google.com/p/django-history-tables/
and
http://qr7.com/2010/10/django-simple-history-ftw/ by Corey Bertram based on
book ProJango by Marty Alchin Chapter 11 (page 263 onwards)
Regards
Chris
From: django-users@googlegroups.com [mailto:django-users@google
Well done! Thanks for all the hard work.
I downloaded my version from http://www.djangoproject.com/download/ and Chrome
says it comes from http://media.djangoproject.com/releases/1.3/Django-1.3.tar.gz
7zip says "Data error in Django-1.3.tar' File is broken". I have downloaded it
a few times with
I must add my SHA1 on Django-1.3.tar.gz is
63e62f9a4834c1c8dbb591aac4ef2b1b84c5ea63 (on all of the downloads I did).
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Chris Matthews
Sent: 23 March 2011 12:20
To: django-users@googlegroups.com
Subject: RE
@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Russell Keith-Magee
Sent: 23 March 2011 12:47
To: django-users@googlegroups.com
Subject: Re: ANN: Django 1.3 released
On Wed, Mar 23, 2011 at 6:25 PM, Chris Matthews wrote:
> I must add my SHA1 on Django-1.3.tar.gz
Hi,
1) My need for getting the current user is that I want the following columns on
all tables: created, created_by, updated and updated_by.
So I defined this abstract class which I inherit from on all models:
class AbstractCommonAll(models.Model):
r''' All our tables will be defined with t
By using the Textarea widget:
class SomeForm(forms.Form):
description = forms.CharField(widget=forms.Textarea())
Regards
Chris
-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of electrocoder
Sent: 31 March 2011 00:18
To: Djang
Hi,
I liked this explanation/convention
http://forum.webfaction.com/viewtopic.php?id=4345 (I opted for this one).
If you want more consider django-css
https://github.com/dziegler/django-css#readme (I have not tried this).
Regards
Chris
-Original Message-
From: django-users@googlegroup
Hi Nge,
Use pgAdmin that was installed with your postgresql. Open a connection to your
database->Schema->Public->Tables. Right-click on your table and click on View
data and then take one of the view options.
You can also open a SQL window and run the SQL select yourself. See pgAdmin's
help.
Hi cootetom,
For decorators you must have a look at the excellent articles/tutorials:
http://www.artima.com/weblogs/viewpost.jsp?thread=240808
http://www.artima.com/weblogs/viewpost.jsp?thread=240845
It covers decorators with (what you want to do) and without parameters.
Regards
Hi Jay,
I am no Geo expert but if you use the CharField then you can specify N/E/S/W
(North/East/South/West) or + and - to control latitude & longitude. With the
DecimalField you can only use the + and -.
BTW, Marty Alchin's book Pro Django (Chapter 5 page 118), shows a nice example
to validat
Hi Marwan,
I am considering an "Excel Export" button wherever I have a table (or jQuery-UI
grid).
If you just want data sheets, before writing something, consider this:
xlwt 0.7.2 Library to create spreadsheet files compatible with MS Excel
97/2000/XP/2003 XLS files, on any platform, with Pytho
. I'll keep you guys updated on my progress and would love to
get all your feedback on the direction I'm taking and if it's
something that any of you can use on your projects. looking forward to
it.
cheers,
Marwan
On Thu, Apr 7, 2011 at 9:50 AM, Chris Matthews wrote:
> Hi Marwan,
37 matches
Mail list logo