I went ahead and filed a bug report (http://code.djangoproject.com/
ticket/10881) and attached two small files that can be used to
reproduce the problem.
--gordon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Djan
Forgot to mention that I'm running revision 10558.
--gordon
--~--~-~--~~~---~--~~
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
Howdy Folks,
I think there is a problem with the sequence_reset_sql method. Here
is the the problem area:
- cut here -
for f in model._meta.many_to_many:
output.append("%s setval('%s', coalesce(max(%s), 1),
max(%s) %s null) %s %s;" % \
(st
Here is a dpaste link to that same bit of code that looks nicer:
http://dpaste.com/hold/33474/
--gordy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
I think I've tracked down the problem. Here is a bit of code from
django.db.models.fields.related.py:
def get_db_prep_lookup(self, lookup_type, value):
# If we are doing a lookup on a Related Field, we must be
# comparing object instances. The value should be the PK of
value,
Howdy Daniel!
> I suspect you have not set the subclass's metaclass to
> models.SubfieldBase - see
> here:http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#the-s...
>
> You need to do this to get any of the overridden methods to be called.
Thanks for the update, but that isn't the
Forgot to add that I'm using the latest revision from subversion
(10558)...
--~--~-~--~~~---~--~~
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 u
Howdy Folks,
I have been testing model inheritance using models that have UUIDField
primary keys. It appears that when you save a new instance of a child
model, the framework is not calling get_db_prep_value() to convert the
UUIDField to a proper format before querying the parent entry.
Let's s
TP I don't know if this applies to your situation or not, but...
On an app I'm currently writing I'm using UUID primary keys for some
of the models. When creating a new instance of one of those models,
say through the admin interface, the development server will start up
an instance of a process
You could try something like this (in models.py)
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Interest(models.Model):
label = models.CharField(max_length=64)
users = models.ManyToManyField(User, blank=True)
def __unicode__(
Jay I'm not sure if this would meet your requirements or not, but I
think you should take a look at this page concerning generic
relations:
http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1
Regards,
--gordon
--~--~-~--~~~---~--~~
You received thi
> http://code.djangoproject.com/ticket/8813
>
> If you could attach the file you dpasted to that ticket and note that you
> see this problem in the admin, that would probably be useful, as recreating
> it in admin should be easier than recreating the user-defined form, view,
> and models involved
Karen I made a small sample to illustrate the problem and posted it
here:
http://dpaste.com/hold/123199/
It's an extremely simple test case and instructions are included in
the comments. I'm not sure if this error is related to the issue that
you told me about or if it is something new entirely
> This sounds like a problem that has been fixed. Are you running with a
> recent enough trunk or 1.0.X branch checkout so that you have this fix:
>
> http://code.djangoproject.com/changeset/9664
Karen I'm running build 9846. I'm going to put together a very
minimal example to illustrate the pr
Howdy Viktor,
On Feb 1, 1:36 pm, Viktor wrote:
> Hi,
>
> did you got any response or did you managed to solve your problem?
> I've just started to search for a UUIDField, and it would be great to
> have proper uuid columns for postgres.
>
> If so do you plan to commit it to django_extensions?
S
Howdy Folks!
I wanted to be able to have UUID primary keys for certain models.
I found the implementation done by the django_extensions project
(http://code.google.com/p/django-command-extensions/) and it works
fine
as is.
But I wanted to be able to have a UUIDField that stored its values in
an
Forgot to say that I did that test in a sample app called "filters".
Hence the table name "filters_member".
--g
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Hi kbs,
Given this:
class Group(models.Model):
name = models.CharField(max_length=64)
class Member(models.Model):
name = models.CharField(max_length=64)
group = models.ForeignKey(Group)
This will return what you want:
Group.objects.extra(where=['id in (select group_id from filt
Adam I'm using 1.0 with Python 2.5.2 (with Ubuntu servers) for my
latest development work and couldn't be happier.
--gordon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
Very cute!
--g
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
Howdy Artemis,
> >>> c = Choice.objects.filter(choice__startswith='Just')
> >>> c.poll
>
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'QuerySet' object has no attribute 'poll'
Here is what is happening to you. Choice.objects.filter() returns a
QuerySet, not a
Howdy Egon!
About this part:
> Now imagine a human enters search terms into a text input field of a
> form, which passes a queryset object instance back to a view, which
> then renders /calls to a template where I can make use of that
> queryset.
> So far correct?
When the user enters search te
Jon I don't see why you couldn't make a custom template tag (see
http://tinyurl.com/2zlzf6). I made one to display the current
application revision and so to use it in a template is just this:
{% revision %}
--gordon
--~--~-~--~~~---~--~~
You received this messag
Ulf I haven't played with this second solution, but I did just check
out a copy of the django-pyodbc project. You should be OK following
the author's instructions. He said to add the django-pydobc directory
(where ever you choose to put it) to your PYTHONPATH. The name of the
module(s) that get
Jamie the command you quoted "python setup.py install" -- on my system
I have to run it as root or else do "sudo python setup.py install" --
will copy the files for that module to the appropriate location.
If the module you are interested in is in pure Python, with no c-code,
you can often just m
Jason try this command and see if it works:
/usr/bin/python
If that takes you into the Python interpreter then you know that
Apple's python is still OK.
So your only problem is that you have the directory /opt/local/bin in
your $PATH ahead of the other directories that are normally in your
pa
SmileyChris the ObjectPaginator is cool and I'm glad you pointed it
out. In my particular case I needed to be able to do more than just
paginating large datasets, but for the O.P. it sounds great!
--g
--~--~-~--~~~---~--~~
You received this message because you a
Hi Wanrong,
This is a very good question. I had a similar problem that I ended up
solving with a non-Django solution because I was adding it to an
existing PHP-based site. But I would like to describe what I ended up
doing to see if it would be possible to adapt it to Django.
In out case we ha
Howdy pinco,
Off the top of my head I don't see away to avoid the test, but you
could bundle it into a method of the Product class:
def get_preferred_measure(self, request):
if request.session['user_preference'] == "cm":
return self.measure_cm
return self.measure_in
--gordy
--
Cool Bert! Thanks for posting the link. Just tried out this theme
and it's pretty nice.
--gordy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-user
xim you can add
MaxRequestsPerChild 1
to your apache config file. This forces Apache to reload everything
for each request.
Of course be sure and remove that directive in any live
configuration!
--gordon
--~--~-~--~~~---~--~~
You received this message because y
I had thought the .pyc files were supposed to be portable...
On Dec 10, 2:29 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote:
> And if I recall correctly, .pyc files are version dependent, machine
> independent, but don't quote me on that :)
I did find this post
http://www.python.org/search/hype
hutuworm not to worry... you can purchase a PDF version of the book
here:
http://www.apress.com/book/view/1590597257
I have done so. It's on my computer now and I can assure you it is
available.
--g
--~--~-~--~~~---~--~~
You received this message because you a
Greetings All,
Just got an email from Amazon saying they have shipped the Django
book. Congrats to the team!!!
--gordy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
I would have the render_to_response in the view (or views if the URL
patterns are different) use the appropriate template based upon the
type of request.
--gordy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Djang
Very nice site Jesse!
Just created an account and posted my first recipe.
--g
--~--~-~--~~~---~--~~
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
Malcolm thanks very much. This is a great idea:
> You can't change the underlying data type for the automatically
> generated primary key without changing Django's source.
>
> So your choices are either to write a custom field or, more easily,
> manually alter the type of the primary key column
Howdy Folks!
I've got a new project coming up that will generate gazillions (that's
a technical term for a whole lot) of objects for certain objects in
the model.
Is it possible to get Django to use a really large integer type for
the automatically-generated primary key, like a serial or bigseri
Andy here are my notes for setting up Django with Dreamhost using
FastCGI:
http://www.gordontillman.info/Development/DjangoDreamhost
--gordy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Joel I recently went through the same process; that is, I migrated
from a Java application, using JasperReports to a Python/Django
application using ReportLab.
It took a bit to get my head around ReportLab, but end the end it has
worked out very nicely.
--gordon
--~--~-~--~~---
Hi chacs66,
If you do you setup right you don't have to worry about it. Here is
an example. Suppose you have an app called myapp and in the myapp
folder you have a urls.py that contains this:
urlpatterns += patterns(
'',
(r'^static_media/(?P.*)$', 'django.views.static.serve',
{'doc
Howdy Alessandro,
This is no problem. You can write a simple context processor that
will do what you want. Here is an example:
Suppose your app is called myapp and you have a file in your myapp
directorory called context_processors.py file with this function:
def media_url(request):
from
Zeb I'm using Komodo 4.0.2 now and it is a big improvement over 3.x.
--gordy
On Apr 4, 10:20 pm, "ZebZiggle" <[EMAIL PROTECTED]> wrote:
> I've been using it for a couple of years now. I'm still using 3.x,
> can't comment on 4.x. The debugging is pretty bad and doesn't really
> work as advertised
Hi Frank,
I'm using the newforms stuff and it lets you do exactly what you
want. Here is one of my simpler forms:
class AddEditCustomerForm(forms.Form):
name = forms.CharField(max_length=200)
customer_type_id = forms.ChoiceField(label="Customer Type")
notes = forms.CharField(widget=
Howdy Equerm,
I have some notes posted on using Django with Dreamhost here:
http://www.gordontillman.info/Development/DjangoDreamhost
--gordy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
On Feb 17, 7:03 am, [EMAIL PROTECTED] wrote:
> Yes, most of the hostings have fastCGI, but not flup.
> I know the best is to have VPS hosting, but they are very expensive,
> and I think I can manage with a shared hosting.
> I think Blouehost looks good.
I'm not sure about other hosting companies,
> I don't think there's any way of accessing the request.user from the
> Form class (is there?). If I could pass in the choices when I'm
> instantiating the form from views.py my problem would be solved. Is
> this possible?
Cathy this is absolutely possible. Here is an example from one of my
pro
Thanks Michael!
I just diff'ed all the changes between the two revisions in question
and they are truly minor. I know think that the new revision is just
reporting an error that was being glossed over silently before. And I
never knew about it because, in spite of the error, everything
function
Howdy Folks!
I have been running with trunk revision 4454. I just updated to
revision 4463 and a bit of code that has never shown any problems is
now broken.. :-(
The error being reported is:
ProgrammingError at /kindledb/customers/5320/
(1064, "You have an error in your SQL syntax; check the
Howdy Mike,
> def current_datetime(request):
> now = datetime.datetime.now()
> html = "It is now %s." % now
> return HttpResponse(html)
>
> - then edit your urls.py to contain
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
> (r'^now/$',
Johnny I don't know what kind of Operating System you are using, but
here is what I do on my Mac and Linux machines...
I create a small script "checkout.sh" that contains the following:
#!/bin/sh
svn co http://code.djangoproject.com/svn/django/trunk/
Make it executable and run it. You will ne
Howdy Folks,
In case it may help someone else who is interested in using Django with
FastCGI on DreamHost, I have posted my setup notes here:
http://www.gordontillman.info/Development/DjangoDreamhost
--gordy
--~--~-~--~~~---~--~~
You received this message beca
Howdy Gang,
I noticed something interesting with newforms and I'm wondering if I'm
doing the right thing or not.
Let's say I have the following in one of my forms:
customer_type = forms.MultipleChoiceField(
required=False,
choices=[(c.id,c.description) for c in CustomerType.objects.all()
Hi Carole,
There is a workaround for this problem. I am using the latest
subversion build of django, so I don't know if it works with the last
official build or not.
Here is an example:
ProductVersion.objects.select_related().order_by("kindledb_product.name","version_number")
Here are the mod
Howdy Bram,
Here is an example of something that I am doing with newforms and
sessions and it seems to work very well. In my case I have a search
form displayed. Depending upon the options that are selected by the
user, when they submit the form it will be handled by one of several
different vi
Adrian I have been experimenting with the SelectDateWidget and I have
noticed one bit of strange behavior. Wondering if I'm using it
incorrectly.
My original element in the form class is this:
date_opened = forms.DateField(initial=date.today())
This works as expected and if the data supplied
Many thanks Honza!
I modified my Form class as follows (this is the complete form class,
not just a fragment...sorry for all of the choppy lines. Trying to
keep from wrapping in the wrong place):
class AddEditContactHistoryForm(forms.Form):
customer_id = forms.Field(
widget=forms.Hid
Howdy Folks,
Here is a fragment of a form definition:
class AddEditContactHistoryForm(forms.Form):
customer_id = forms.Field(widget=forms.HiddenInput,required=False)
contact_history_type_id = forms.ChoiceField(label='Contact Type',
choices=[(c.id,c.description) for c in
ContactHist
Thanks Adrian and Alex!
Adrian: gotta tell ya I really enjoy working with Django. We had a
nice talk about it at our Python user's group meeting here in Houston
on 12/19. One of the guys there is the author of the
http://houstoncrimemaps.com/ site (pure Django!)
--gordy
--~--~-~--~-
Howdy Folks!
I'm very new to Django and have been experimenting with newforms. I
would be most grateful if anyone would care to take a look at this
small sample to see if I'm doing things in an efficient manner. It
works great, but I want to make sure I'm not doing something stupid..
:-) To s
Austin here is an object from the model of one of my applications. The
self referential many-to-many relationship is optional and works find
in the admin interface. Note that you may or may not need the
symmetrical part.
class Customer(models.Model):
"""
A Customer is anyone we have so
Howdy Matt!
Here is a small, complete working sample. When you initially load the
page it just displays the choices and prompts you to select a value and
click submit. When you submit it, it redisplays the form and then
displays what choice you selected.
urls.py:
from django.conf.urls.defaults
62 matches
Mail list logo