On Sat, Apr 11, 2009 at 2:44 AM, Kenneth Gonsalves
wrote:
>
> On Saturday 11 April 2009 11:16:52 Nalini wrote:
> > select * from Table where dates BETWEEN '2009-01-01' AND '2009-01-31'
> > Can any one help me?
>
> Model.objects.filter(mydate__gte='2009-01-01'
> ).filter(mydate__lte='2009-01-31')
On Saturday 11 April 2009 11:16:52 Nalini wrote:
> select * from Table where dates BETWEEN '2009-01-01' AND '2009-01-31'
> Can any one help me?
Model.objects.filter(mydate__gte='2009-01-01' ).filter(mydate__lte='2009-01-31')
--
regards
kg
http://lawgon.livejournal.com
--~--~-~--~~
Hi,
I am using django, python and sqlite3 for my web page.
I want the datas from the database between two dates. how do i handle
it in django.
i want the query for this
select * from Table where dates BETWEEN '2009-01-01' AND '2009-01-31'
Can any one help me?
--~--~-~--~~-
Ahh...never mind!
I tried doing a {% for S.M %}
that didn't work, but {% for S.M.all %} did
thanks for being my sounding board...
On Apr 10, 10:38 pm, Anthony wrote:
> Hello,
>
> I'm passing queryset 'S' to a template. S has several attributes, M,
> N and O.
>
> M has a one-to-many relation
Hello,
I'm passing queryset 'S' to a template. S has several attributes, M,
N and O.
M has a one-to-many relationship with T. I need to display:
N, O, T^1, T^2 through T^n, etc. (the T list would be a filtered
subset)
Can this be done via template tags? (Will I have to make custom
ones?)
On Fri, 2009-04-10 at 21:24 -0700, patrickk wrote:
>
>
> On Apr 11, 6:03 am, Malcolm Tredinnick
> wrote:
> > On Fri, 2009-04-10 at 20:17 -0700, patrickk wrote:
> > > anyone?
> >
> > *sigh* If somebody had an answer, they would have answered already. It's
> > kind of self-fulfilling prophecy!
>
On Apr 11, 6:03 am, Malcolm Tredinnick
wrote:
> On Fri, 2009-04-10 at 20:17 -0700, patrickk wrote:
> > anyone?
>
> *sigh* If somebody had an answer, they would have answered already. It's
> kind of self-fulfilling prophecy!
your answer shows that it´s sometimes useful to ask twice.
>
> [...]
On Fri, 2009-04-10 at 20:17 -0700, patrickk wrote:
> anyone?
*sigh* If somebody had an answer, they would have answered already. It's
kind of self-fulfilling prophecy!
[...]
> >
> > is this intentional? the docs doesn´t explain this and my assumption
> > is that different adminsite instances are
On Fri, 2009-04-10 at 20:36 -0700, nixon66 wrote:
> The meta option is already there. And the myproject_country table is
> still created.
I seem to remember there have been some problems where querying the
existing tables in the database returned them with different casing of
the name to what the
The meta option is already there. And the myproject_country table is
still created.
On Apr 10, 4:51 pm, Ramiro Morales wrote:
> On Fri, Apr 10, 2009 at 5:29 PM, nixon66 wrote:
>
> > I have a legacy database that I used inspectdb on to generate models.
> > Once I generated the models and cleaned
anyone?
I´m not sure whether or not to open a ticket on this issue. It could
be "solved" with a better explanation in the docs.
Question is: Is this a "bug" or is the documentation incomplete/
inexplicit?
thanks,
patrick
On Apr 9, 9:50 am, patrickk wrote:
> I´ve recently figured out that if y
On Fri, 2009-04-10 at 18:15 -0700, chris wrote:
>
>
> On Apr 10, 6:55 pm, Malcolm Tredinnick
> wrote:
>
> > However there could be, and likely are, many TextChar objects with the
> > same edition value, so it would be ambiguous as to which particular
> > object to return. Since there's no natu
On Apr 10, 6:55 pm, Malcolm Tredinnick
wrote:
> However there could be, and likely are, many TextChar objects with the
> same edition value, so it would be ambiguous as to which particular
> object to return. Since there's no natural choice, there's no API to ask
> Django to guess or provide a
On Sat, 2009-04-11 at 08:47 +0800, Russell Keith-Magee wrote:
> On Sat, Apr 11, 2009 at 5:53 AM, Poromenos wrote:
> >
> > Hello,
> > I created a model that has a ForeignKey to ContentType, but now I
> > can't use my test fixtures, since the IDs they point to are random
> > every time the test dat
On Sat, Apr 11, 2009 at 5:53 AM, Poromenos wrote:
>
> Hello,
> I created a model that has a ForeignKey to ContentType, but now I
> can't use my test fixtures, since the IDs they point to are random
> every time the test database is created. I can't dump the contenttypes
> data because then I get
Hi Malcolm, thanks for the reply.
We have embedded systems that connect to a twisted server that updates
table Foo periodically. I am trying to write an http server with
Django (which has been very helpful) that allows an overview of the
embedded systems status.
The main view makes an ajax call
On Apr 10, 4:46 pm, Oleg Oltar wrote:
> Hi!
>
> I have a model which contains several TextFields and CharFields. I want to
> make all char fields longer and wider. How to do it?
>
> Thanks,
> Oleg
You can supply your own form that is using customized widgets to
construct the fields with.
http:/
On Fri, Apr 10, 2009 at 7:52 PM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:
>
> On Fri, 2009-04-10 at 19:44 -0400, Alex Gaynor wrote:
> >
> >
> > On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick
> > wrote:
> [...]
> >
> > Particularly with iterators, storing the (next head i
On Fri, 2009-04-10 at 19:44 -0400, Alex Gaynor wrote:
>
>
> On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick
> wrote:
[...]
>
> Particularly with iterators, storing the (next head item, rest
> of
> iterator) pair in a heap leads to a very neat and fast way to
On Fri, 2009-04-10 at 16:04 -0700, M Godshall wrote:
> I have two models, Comment and Project. Comments are connected to a
> Project through a GenericForeignKey, and each Project is assigned to a
> particular user. I'd like to retrieve the latest comments for all the
> projects that a particular
On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:
>
> On Fri, 2009-04-10 at 16:44 -0400, Alex Gaynor wrote:
> >
> >
> > On Fri, Apr 10, 2009 at 4:40 PM, veearrsix
> > wrote:
> >
> > This question seems to have been asked a few times, but never
> >
On Fri, 2009-04-10 at 14:46 -0700, Mr. T wrote:
> Sorry, a QuerySet eval question. Yeah, I'm dumb I know.
>
> My view is creating a query set, XXX.objects.all(). Stale data is
> being served up all the time. Read the docs about generic views, when
> sets are evaluated, some old posts in this grou
On Fri, 2009-04-10 at 16:44 -0400, Alex Gaynor wrote:
>
>
> On Fri, Apr 10, 2009 at 4:40 PM, veearrsix
> wrote:
>
> This question seems to have been asked a few times, but never
> answered
> fully.
Not quite true. It's been answered fully a lot of times: querys
On Fri, 2009-04-10 at 12:16 -0700, Adam Fraser wrote:
[...]
> The problem I'm running into is that the value that comes into render
> for the ManyToManyField is a list of the id's for the selected stains
> and not the stains themselves. I assume I should be getting them
> somehow through the djan
On Fri, 2009-04-10 at 12:01 -0700, Joe Sr. wrote:
[...]
> That's a good idea I will check on, but it wouldn't explain why it
> works with the development server and not mod_python.
It might well explain that. There's no guarantee about import order and
certainly no guarantee that it will be the s
On Fri, 2009-04-10 at 13:25 -0400, Alex Gaynor wrote:
[...]
> Take a look at the values() method on a queryset:
> http://docs.djangoproject.com/en/dev/ref/models/querysets/#values-fields
Since the original poster was explicitly asking about custom SQL
situations, this isn't a valid solution. Sure
On Fri, 2009-04-10 at 10:24 -0700, MS wrote:
> Hi Malcolm!
>
> > > then is there any good (built-in) way
> > > to write custom SQL queries wich would return dicts instead of tuples?
> >
> > You know the order the values will be returned in and you know the names
> > of the columns. So you can cr
On Fri, 2009-04-10 at 05:45 -0700, nikita kozlovsky wrote:
> On Mar 9, 3:21 am, Malcolm Tredinnick
> wrote:
>
> Hello, Malcolm.
>
> > > Again, the correct syntax would be:
> > > Message.objects.filter(student__isnull=True)
>
> Why ORM uses LEFT OUTER JOIN on this query ? Why not "... WHERE
> s
I have two models, Comment and Project. Comments are connected to a
Project through a GenericForeignKey, and each Project is assigned to a
particular user. I'd like to retrieve the latest comments for all the
projects that a particular user is assigned to, but according to the
Django documentati
Hello,
I created a model that has a ForeignKey to ContentType, but now I
can't use my test fixtures, since the IDs they point to are random
every time the test database is created. I can't dump the contenttypes
data because then I get many duplicate inserts, since Django rebuilds
them every time i
On Apr 10, 9:29 pm, lkcl wrote:
> > We've recently done the dance through a wide range of tools and ended up
> > selecting Qooxdoo (qooxdoo.org) for a variety of reasons.
http://demo.qooxdoo.org/current/playground/#Calculator
ok - found one that works. and, actually, for a javascript
frame
Hi!
I have a model which contains several TextFields and CharFields. I want to
make all char fields longer and wider. How to do it?
Thanks,
Oleg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
Sorry, a QuerySet eval question. Yeah, I'm dumb I know.
My view is creating a query set, XXX.objects.all(). Stale data is
being served up all the time. Read the docs about generic views, when
sets are evaluated, some old posts in this group. Tried ._clone(),
tried iteration, tried len(), nothing
> We've recently done the dance through a wide range of tools and ended up
> selecting Qooxdoo (qooxdoo.org) for a variety of reasons.
i'd love to be able to evaluate it, but i get this:
Error: unterminated string literal
Source File: http://demo.qooxdoo.org/current/demobrowser/script/demobrow
I have a field for emails. I want it to be blank if nothing in there
and unique if something is. I get a duplicate field error if I have to
messages with blank fields. I can use null = True and it works, but
django's admin blows up. I seen some stuff, but no real solution. Does
anyone have a good
On Apr 8, 7:43 pm, Scott Newman wrote:
> > I've been looking at a couple of RIA frameworks, namely Sproutcore and
> > Cappuccino. The feel a bit too heavy for me. Sproutcore does not
> > integrate well with Django
> > The reason I'm posting is to ask the community if they have know of
> > any
Ok, I did some search on web and i took closer look at the
errormessage. :
Request information
GET
No GET data
POST
VariableValue
poll-trans-content_type-object_id-0-keel
u'1'
poll-trans-content_type-object_id-0-id
u''
poll-trans-content_type-object_id-1-keel
u'2'
poll-trans-content_type
On Apr 8, 2:34 pm, Rob Madole wrote:
> I've been looking at a couple of RIA frameworks, namely Sproutcore and
> Cappuccino. The feel a bit too heavy for me. Sproutcore does not
> integrate well with Django. Cappuccino uses Objective-J as the
> language and I'm not convinced this is a good ch
On Fri, Apr 10, 2009 at 5:29 PM, nixon66 wrote:
>
> I have a legacy database that I used inspectdb on to generate models.
> Once I generated the models and cleaned them up, I ran manage.py
> syncdb. Everything went fine except I have one model that it creates
> another table from with the name of
On Fri, Apr 10, 2009 at 4:40 PM, veearrsix wrote:
>
> This question seems to have been asked a few times, but never answered
> fully.
>
> I am looking to query more than one table, but return the results to a
> template as one queryset ordered by date.
>
> The reason i'm doing this is to create a
This question seems to have been asked a few times, but never answered
fully.
I am looking to query more than one table, but return the results to a
template as one queryset ordered by date.
The reason i'm doing this is to create a single queryset including
information from a blog table, twitter
Thank you both!
Exactly what I need, both for now and moving forward.
On Apr 10, 12:59 pm, Colin Bean wrote:
> Take a look at the reverse() function and the "url" template
> tag:http://docs.djangoproject.com/en/dev/topics/http/urls/#reversehttp://docs.djangoproject.com/en/dev/ref/templates/bu
I have a legacy database that I used inspectdb on to generate models.
Once I generated the models and cleaned them up, I ran manage.py
syncdb. Everything went fine except I have one model that it creates
another table from with the name of the app attached to the front. So
the model is called coun
Here's a lighttpd config (just the part for a single website at
fictional ip '1.2.3.4')
project lives in the 'user' home folder, - _project will be your
django project folder - ie the one with 'manage.py'
look at the lighttpd docs for the specifics of the "main" options.
email me off list if yo
Take a look at the reverse() function and the "url" template tag:
http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#url
The "url" tag is what you want to generate a link in your template
based on one of your URL patterns.
On Apr 10, 1:50 pm, Anthony wrote:
> Hi Everyone,
>
> This is really basic and I tried looking up this question since it
> can't be a new one, but the closest thread I found was this one:
>
> http://groups.google.com/group/django-users/browse_thread/
> thread/d2524403e13fcd22/515358199feebc68?lnk
Hello,
I'm using a ManyToManyField to model a relationship where a "Project"
object may have many different "Stain" objects. The code is working
successfully and looks like this
class Stain(models.Model):
def __unicode__(self):
return unicode(self.name)
name = models.CharField(m
I realized my question was just a bit off. What I really want is to
create a TabularInline to edit the members relationship on the Group
interface. This is what you get when you use an intermediary model,
as well as the ability to edit the other members of that model.
I could, of course, create
On Apr 10, 1:27 pm, Alex Gaynor wrote:
> On Fri, Apr 10, 2009 at 2:24 PM, Joe Sr. wrote:
>
> > I have been using this little trick to get a list of all my model
> > classes that are subclasses of Component:
>
> > component_list = []
>
> > for k in django.contrib.admin.site._registry:
> > if i
Hi Everyone,
This is really basic and I tried looking up this question since it
can't be a new one, but the closest thread I found was this one:
http://groups.google.com/group/django-users/browse_thread/
thread/d2524403e13fcd22/515358199feebc68?lnk=gst&q=url+home
+page#515358199feebc68">Home pag
On Apr 10, 12:10 pm, Malcolm Tredinnick
wrote:
> On Fri, 2009-04-10 at 02:34 -0700, herr.klein...@googlemail.com wrote:
> > Thanks Malcom.
>
> > All right lets see if i could put my real problem simpler. Lets say
> > you are the tutor of a programming course and you want to check the
> > progra
On Fri, Apr 10, 2009 at 2:24 PM, Joe Sr. wrote:
>
> I have been using this little trick to get a list of all my model
> classes that are subclasses of Component:
>
> component_list = []
>
> for k in django.contrib.admin.site._registry:
>if issubclass(k, Component):
>component_list.app
I have been using this little trick to get a list of all my model
classes that are subclasses of Component:
component_list = []
for k in django.contrib.admin.site._registry:
if issubclass(k, Component):
component_list.append(k)
It works splendidly under the development server or usi
When working with foreign keys, it's really easy to detect changes in
the field by writing a custom save method. It would look something
like this:
def save(self, force_insert=False, force_update=False):
old_user = None
if Project.objects.filter(id__exact=self.id).count(): #the p
The way I achieved this was to make my own registration form and use
this:
email = forms.EmailField(widget=forms.TextInput(attrs=dict
(attrs_dict,maxlength=75)),label=_(u'Email address'))
where attrs_dict was earlier defined as:
attrs_dict = { 'class': 'required' }
also, the email address isn't
Hi all,
we've been using the django User model from contrib.auth.models
As we want to re-use as much code as possible, is there a way to edit
the class properties, making the "email" field required? As a default
this is not a required field. Gooogled for some answers but didn't
find one, but if I
On Fri, Apr 10, 2009 at 1:24 PM, MS wrote:
>
> Hi Malcolm!
>
> > > then is there any good (built-in) way
> > > to write custom SQL queries wich would return dicts instead of tuples?
> >
> > You know the order the values will be returned in and you know the names
> > of the columns. So you can cr
Hi Malcolm!
> > then is there any good (built-in) way
> > to write custom SQL queries wich would return dicts instead of tuples?
>
> You know the order the values will be returned in and you know the names
> of the columns. So you can create an iterator that returns the
> dictionary results:
>
>
> On 10 Apr., 16:28, "bax...@gretschpages.com"
> wrote:
>
> > What I'm after is documentation for the admin users, similar to the
> > generated documentation, only less technical. A simple how-to for
> > people who just want to know how to do things in the admin, but don't
> > care about views, m
something like this is included with grappelli, see
http://code.google.com/p/django-grappelli/
patrick
On 10 Apr., 16:28, "bax...@gretschpages.com"
wrote:
> What I'm after is documentation for the admin users, similar to the
> generated documentation, only less technical. A simple how-to for
>
Hi cgarvey
On 10 Apr., 15:25, cgarvey wrote:
> It (migrating Django to appEngine via appEnginePatch) required changes to the
> models,
You are right, model changes are unevitable when migrating from a
relational database, MySQL for example to Google's big table.
Google doesn't use a relationa
What I'm after is documentation for the admin users, similar to the
generated documentation, only less technical. A simple how-to for
people who just want to know how to do things in the admin, but don't
care about views, models and template tags.
Is there an easy way to create/generate such a th
On Apr 9, 12:45 am, higer wrote:
> When I upload a PNG file and use PIL to handle it,there will be an
> error occured:
> 'NoneType' object is unsubscriptable
>
> I do not know why and other formats(BMP GIF JPG JPEG) are all ok.
I don't know if this is your problem, but in order to use certain fi
On Apr 10, 11:33 am, Konrad Martin wrote:
> there is the appEnginePatch project too. Dedicated to deploy existing
> Django on
> appEngine.http://code.google.com/p/app-engine-patch/wiki/Documentation
Thanks Konrad,
I came across that afterwards, and had a quick look. It still required
changes
On Mar 9, 3:21 am, Malcolm Tredinnick
wrote:
Hello, Malcolm.
> > Again, the correct syntax would be:
> > Message.objects.filter(student__isnull=True)
Why ORM uses LEFT OUTER JOIN on this query ? Why not "... WHERE
student_id IS NULL" ?
--~--~-~--~~~---~--~~
You
Hi cgarvey
there is the appEnginePatch project too. Dedicated to deploy existing
Django on appEngine.
http://code.google.com/p/app-engine-patch/wiki/Documentation
It has got a ready made app-engine-patch sample. Download
http://app-engine-patch.googlecode.com/files/app-engine-patch-sample-1.0.zi
Hi Sergio
> - Google App Engine[1] - you will need adapt somethings in your code.
There is the project appEnginePatch to deploy django on Google
appEngine out of the box.
http://code.google.com/p/app-engine-patch/wiki/Documentation
The app-engine-patch has got a ready made sample. Download
http
On Fri, 2009-04-10 at 05:41 -0700, AndyB wrote:
> Hi,
>
> I've got a model called Courses and a model that inherits from it
> called SpecialCourses that has some extra fields.
>
> It seems that any SpecialCourses I add also show up in the changelist
> for Courses which will be confusing for cont
On Apr 8, 8:59 pm, Malcolm Tredinnick
wrote:
> (1) Reflect the requirement in the data modelling. Particularly useful
> if it's going to be a firm requirement, always. The way to provide
> relations between a model and multiple other models is to use the
> GenericRelation field, which tracks the
Hi,
I've got a model called Courses and a model that inherits from it
called SpecialCourses that has some extra fields.
It seems that any SpecialCourses I add also show up in the changelist
for Courses which will be confusing for content editors ("remember to
edit them under SpecialCourses or yo
Thanks mucho Malcolm. It seems I did forget to set the form encoding
in the one template but not the others!
> The usual reason files aren't uploaded is because you forget to specify
> the enctype attribute as a multipart/form-data encoding.
> Seehttp://docs.djangoproject.com/en/dev/ref/forms/ap
On Fri, 2009-04-10 at 04:50 -0700, MS wrote:
[...]
> If it's not available any longer
Which it isn't.
> then is there any good (built-in) way
> to write custom SQL queries wich would return dicts instead of tuples?
You know the order the values will be returned in and you know the names
of the
On Fri, 2009-04-10 at 04:41 -0700, John Baker wrote:
> I have a form that validates the size of a file and it works in one
> page but not another. This is very strange. The only difference
> between the two templates is that the working one has only a single
> form (below) and the non-working one
Hi All,
Who dumped dictfetchall from Django? I can see it used to be there,
but I can't find it in 1.0.
http://code.djangoproject.com/ticket/2662
http://blog.doughellmann.com/2007/12/using-raw-sql-in-django.html
If it's not available any longer then is there any good (built-in) way
to write custo
I have a form that validates the size of a file and it works in one
page but not another. This is very strange. The only difference
between the two templates is that the working one has only a single
form (below) and the non-working one has 3 forms (including the form
below). For some reason, in a
does anyone know how to solve this problem?
Alan
On 9 apr, 21:54, zayatzz wrote:
> Thanks.
>
> That worked for enabling translations for poll names - i had to insert
> 'from django.contrib.contenttypes import generic', right?
> It worked, but it raised few more questions. When creating poll i g
Yes, thanks a lot. I got it working! :)
Patrick
Website: www.pknews.org
On Wed, Apr 8, 2009 at 9:24 PM, Xpineapple wrote:
>
>
> Per manual ( www.djangobook.com/en/2.0/ ), Chapter 6, I try to setup
> the admin site. My version of Django is (1, 0, 2, 'final', 0) which
> is covered by this man
I want to get a thumbnail version of the uploaded image,so I have to
use PIL to handle it.
But I do not know why that error occured.
We can know that the chafferer is either the Django or the PIL.
Then I wrote a .py script to handle images of different format ,all
goes well.The operations are the
On Fri, 2009-04-10 at 02:34 -0700, herr.klein...@googlemail.com wrote:
> Thanks Malcom.
>
> All right lets see if i could put my real problem simpler. Lets say
> you are the tutor of a programming course and you want to check the
> programming assignments semi-automatically.
> So you would set up
On Fri, 2009-04-10 at 02:05 -0700, chris wrote:
> Hi there,
>
> Here I am trying to use the aggregate functions available in SVN trunk
> (I am not sure if they have been released). The following is a
> simplified version of the models involved:
>
> class Edition(models.Model):
> edkey = mod
Thanks Malcom.
All right lets see if i could put my real problem simpler. Lets say
you are the tutor of a programming course and you want to check the
programming assignments semi-automatically.
So you would set up a Task to which a student can submit a solution.
If the solution is accepted depen
On Fri, Apr 10, 2009 at 4:05 AM, chris wrote:
> So I want to find out how many characters do occur in which edition
> and I get the result as expected. However, instead of the edition
> objects, what I get back are the pk values of the edition.
This is expected behavior; when you use values() y
Thanks and i tried to do in same fashion as Bennett suggested
but getting errror
def register_handle_form(request, redirect=None):
print "I am in handle form"
form_class = utils.get_profile_form()
if request.method == 'POST':
print "i am in profile post"
profileform =
If I understand correctly the same problem solve by this code:
def colored_name(self):
return '%s %s' %
(self.color_code, self.first_name, self.last_name)
colored_name.allow_tags = True
manual http://docs.djangoproject.com/en/dev/ref/contrib/admin/#list-display
On Apr 9, 8:31 pm, Psiho
hi,
1) I have done request.session.set_expiry(0)
which means user session should expire when he closes the
browser.
But it is not happening i have tested it several times? Any hint
on what can be wrong?
HOw did it test?
---
By closing browser and opening
Hi there,
Here I am trying to use the aggregate functions available in SVN trunk
(I am not sure if they have been released). The following is a
simplified version of the models involved:
class Edition(models.Model):
edkey = models.TextField()
class TextChar(models.Model):
edition = mod
Thanks
this is my misunderstanding,I had consider flup can be a webserver and
other webserver can call it.
l`ll try to setup lighttpd or cherokee.
thanks again
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
87 matches
Mail list logo