[EMAIL PROTECTED] skrev:
> Just installed python/apache/django/mod_python with all the latest
> versions.
>
> I think I got most of my PATH variables set up correctly. However,
> when I try:
>
> C:\django>django-admin.py startproject testproject1
> Traceback (most recent call last):
> File
Kenneth Gonsalves skrev:
> On 02-Oct-07, at 6:21 PM, Nis Jørgensen wrote:
>
>
>>> get_or_create, *only* using the value of 'word' in the query - if
>>> created, then I do an update to set the other fields - otherwise I
>>> leave it alone.
>>&g
Kenneth Gonsalves skrev:
>
> I now do
> get_or_create, *only* using the value of 'word' in the query - if
> created, then I do an update to set the other fields - otherwise I
> leave it alone.
You could also use the "defaults" argument to get_or_create:
Kenneth Gonsalves skrev:
> hi,
>
> I have a view that takes a sentence in unicode from a database,
> splits it into words and dumps those words in the Word table. The
> 'word' in word table is unique, and it is expected that duplicates be
> rejected, so I put 'save()' within a try-except
stanleypark skrev:
> We just finiched a really cool RSS feed news reader. I need people
> comments on it.
> here is the link of the web site.
>
I see no link at this point in your post. Anyway, who are "we"?
> If you wish to know more about RSS feeds here is a group link that I
> just started.
zeliboba skrev:
> actually, I understand how it works, it seems to be a bug anyway.
> consider this:
>
> from django.db import models
>
> class Author(models.Model):
> name = models.CharField(maxlength=50)
>
> class Reference(models.Model):
> """
> >>> a = Author(name='some name')
>
cschand skrev:
> Thanks for you replies
>
> but one thing... there are some differences between get and filter
>
> from get return obj is user model obj
> but in filter it is recordsets... (I don't know i am right or not)
>
.get(...) returns a model object
.filter(...) returns a queryset -
Kenneth Gonsalves skrev:
> On 20-Sep-07, at 4:42 PM, Werner F. Bruhin wrote:
>
>
>>> other pdf reports. Not this particular one. I *know* there has to be
>>> some very simple explanation for this - but cant for the life of me
>>> find what it is.
>>>
>>>
>> Does "Good" in Finish use
Benedict Verheyen skrev:
> Hi,
>
> a while back i updated my python isntall to version 2.5.1. on a Windows
> 2000 server. It also runs Apache 2.2 & mod_python for Django.
> Since the python upgrade, i got this "unknown encoding cp0" error.
>
> I hadn't changed anything to the code. The errors
patrickk skrev:
> now I get:
> ImportError: No module named django.core.management
>
> the directory "django_src" is on my python-path.
>
It probably isn't on cron's python-path, though. Try adding
PYTHONPATH=/your/python/path
to the top of your cronta
Michal skrev:
> Hello,
> I have problem with inserting duplicate rows into DB.
>
> There is registration form on my site. User fill email address together
> with additional parameters (form definition: http://dpaste.com/19959/).
> After POST it to the server, email is checked in form against
John M skrev:
> the ID is the primary key ID generated by django on models.
>
> basically, it's not the syntax im having issue with, i think the
> selected_id is being passed / parsed as a string not an intenger like
> ID is.
>
So where do you get the selected_id from? GET/POST variables are
Xan skrev:
> class Aclass(models.Model):
> be = models.ForeignKey('B')
> ce = models.ManytoManyfield('C')
>
> class B(models.Model):
>[...]
>
> class C(models.Model):
> [...]
>
> Suppose that with admin interface, I put:
> be = b1 (b1 is B)
> ce has c1, c2,
Ryan K skrev:
> Hi. I have a few languages I've translated my site into. They all work
> except Simplified Chinese. Any hints as to why?
>
Try being more specific than "does not work". Do you see English,
garbled characters, something else?
> This is in my settings file:
>
> LANGUAGES = (
>
[EMAIL PROTECTED] skrev:
> thanks for your reply! i resolved using this code in the models.py
> before save(): def save(self): if len(self.title)<6: raise
> ValidationError("cannot be blank or small than 6 byte!") it works for
> me!
>
> but i find this code in django-tagging
[EMAIL PROTECTED] skrev:
> i used this: def isBlank(field,all_data): if field_data is None:
> raise ValidattionError(u'Cannot be Blank.')
>
> it not work for me.
It seems you are being bitten by the behavior described thus in the
documentation:
"""
After a form has been submitted, Django
)
>
> but that doesn't work either (even though the raw SQL does, even with
> the WHERE id IN (...). )
>
> Any ideas?
>
Idea #1:
Be more specific than "does not work"
#2:
Find out what SQL is generated, and how it differs from what you run
from the db
Michael Radziej skrev:
> On Thu, Sep 06, Russell Keith-Magee wrote:
>
>
>> On 9/6/07, Michael Radziej <[EMAIL PROTECTED]> wrote:
>>
>>> I'd *love* to have a sneak preview of your changes, any way? ;-)
>>>
>> Hey! Get to the back of the line! No queue-jumping! I was here first! :-)
Kelsey Ruger skrev:
> I am looking for a python based utility that will allow a user to sign
> their name with a mouse and save the resulting image for inclusion in
> a PDF. Has anyone heard of something like this?
>
A word of warning: Users may not be able to prodcue anythin that looks
like
[EMAIL PROTECTED] skrev:
> I'm having trouble piecing together a query for this model:
>
> class Ticket(models.Model):
> ...
> assigned_user = models.ForeignKey(User)
> name = models.CharField(maxlength=255)
> private = models.BooleanField(default=False)
>
> I'm trying to get all
Michael Radziej skrev:
> On Thu, Sep 06, [EMAIL PROTECTED] wrote:
>
>
>> I thought I was close with this, but it only returned tickets assigned
>> to me. (The parenthesis around the 2nd and 3rd Q's obviously didn't
>> help)
>>
>> Ticket.objects.filter(Q(private__exact=False) |
>>
Nader skrev:
> I have used 'inspectdb' to produce the model, because I had a dump
> mysql file. In Meta section of model I have defined the table name:
>
> class Meta:
> db_table = 'Dataset'
>
> Besides If I check the application model with "python manage.py sqlall
> dataset" I see the
Nis Jørgensen skrev:
> Emil Björklund skrev:
>
>> Hi folks,
>>
>> Two part post:
>>
>> 1. Just wanted to introduce myself: Emil, web designer/developer from
>> Malmö in southern Sweden, studying Information Architecture at Malmö
>> University w
ng the methods used by svn or similar. In this
case, ask your system administrator for help.
Nis Jørgensen
No House IT
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gro
Malcolm Tredinnick skrev:
> On Tue, 2007-08-21 at 21:21 -0700, Catriona wrote:
>
>> What I have is an event which has about 12 fields. Optionally any
>> combination of a single weather record, a single event detail record,
>> a single survey record and one of four event subclass records may be
Peter Melvyn skrev:
> Hi all,
>
> if I'm not mistaken, if I have a model with unique constraint
> 'unique_together', Django does not support composite index of related
> columns, i.e.
>
> class AModel (models.Model):
> col_a = models.CharField(maxlength=20, db_index=True)
> col_b =
ble to work
> independently, but also be able to demonstrate effective people and
> time management skills, so as to deliver work within our deadlines.
>
> Send us your daily/hourly rates, your availability as well as a few
> words about work you've done before.
>
> Any ques
Austin Govella skrev:
> Is there an existing Django app for managing locations?
>
> Specificall, countries, states/provinces, cities, and specific
> locations with addresses.
>
>
>
> (I was just adding such an app to my project, but thought I might be
> duplicating someone better effort...)
>
Steven Armstrong skrev:
> Chris Hoeppner wrote on 08/25/07 18:40:
>
>> Hi there!
>>
>> I was just wondering how to dynamically "or" together an indetermined
>> quantity of Q objects. They're constructed from a string like q=a+b+c,
>> which would get stiched together as "(Q(field=a) |
Greg skrev:
> Nis,
> Thanks for the help. We'll I got my view to work for website visitors
> searching by any combintation of Size, Price, and Color. My code is
> not the most efficient and I wonder how the performance is going to be
> once I add more products and take it off of developmental
Greg skrev:
> Tim,
> I added your code into my view. However, it seems to error out on me
> when I get to the line 'if 'color' in request and request['color'] <>
> NO_COLOR: '. The error says:
>
> KeyError at /rugs/searchresult/
> '0 not found in either POST or GET'
>
The error message
[EMAIL PROTECTED] skrev:
> Wow, thanks for the reply. I can't get this to work though--I get an
> "iteration over non-sequence". Can you take a look?
>
author.book_set is a Manager. You need author.book_set.all() (or
author.book_set.all in a template) to get a QuerySet which you can
iterate
Lucky B skrev:
> how about surrounding the statement with a try and work the leap year
> to regular year case with the exception?
That seems like overkill. There isn't really any leap-year handling
necessary:
import datetime.date as date
def age (d1, d2=None):
if not d2:
d2 =
[EMAIL PROTECTED] skrev:
> I think the problem is related to passing the resultsdict dictionary to the
> DisplayForms.
> Once, I did not pass in the dictionary then the initial value works.
>
Yes. Passing in values creates a bound form. Initial data are used only
for unbound forms. I think
Nathan Ostgard skrev:
> list_display can use functions as their value... so, you can have:
>
> class Employee(models.Model):
> sub_dept = ForeignKey(SubDept)
>
> def company(self):
> return sub_dept.dept.company
>
> def dept(self):
> return sub_dept.dept
>
> class Admin:
>
[EMAIL PROTECTED] skrev:
> I am still having problems setting the select widget to the 3rd value in the
> drop down list.
> Looking further it seems that the html does not have the selected="selected"
> value in any of the items.
> The documentation states that if use a bound form you will
Nimrod A. Abing skrev:
> Hello,
>
> I was just going through the current docs and wanted to look up some
> examples and I noticed that the Model Examples page is gone:
>
> http://www.djangoproject.com/documentation/models/
>
> though it can still be accessed in the older versions of the docs.
>
>
Russell Keith-Magee scribit:
> On 7/31/07, Nis Jørgensen <[EMAIL PROTECTED]> wrote:
>
>> I had the problem that any db error in any of my tests (including
>> setups) would cause all following tests to fail (because the transaction
>> was not rolled back). This w
I want to use the test framework with my application, using
postgresql/psycopg2.
I had the problem that any db error in any of my tests (including
setups) would cause all following tests to fail (because the transaction
was not rolled back). This was made even worse by the fact that I used
the
Greg skrev:
> I post some info to a view. When I do a 'assert False, request.POST'
> I see the following
>
> [u'2'], u'5': [u'2'], u'4': [u'3'], u'7': [u'---'], u'6': [u'2'],
> u'y': [u'4'], u'8': [u'---']}>
>
> It should only have 8 keys (1 through 8). Instead I see the keys 'x'
> and 'y'?
Michael Lake skrev:
> Hi all
>
> Nis Jørgensen wrote:
>
>> The argument to HttpResponseRedirect is a url. You seem to be confusing
>> it with a template.
>>
>
> OK I can do this:
>
> code
> # some error occu
Michael Lake skrev:
> Hi all
>
> A really simple question:
>
> I'm mostly using code like this:
> data = {'message': 'Some message to user...'}
> return render_to_response('main.html', data)
>
> But for error messages to users if one wishes to use a redirect like this:
> return
AnaReis skrev:
> Hi all!
> I have a delete that isn't working properly. It deletes more than 1
> register when it shouldn't because I'm specifying the primary key in
> the filter.
> The class file is this:
> class UserInstrument(models.Model):
> user_name = models.CharField(primary_key=True,
Jonathan Buchanan skrev:
> On 7/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>> Hi group,
>>
>> I have a rather complex hierarchy of models. Say, I have a model A. A
>> has a 1:N relation to model B, which itself has a 1:N relation to
>> model C.
>>
>> What I want is a single web
to_see skrev:
> "Any sufficiently advanced technology is indistinguishable from
> magic."
> Arthur C. Clarke, "Profiles of The Future", 1961 (Clarke's third
> law)
>
> Snippet #26 solved my problem, essentially in two lines. I could not
> write those lines for myself now, and I'm not
l5x skrev:
> Hello,
>
> I have code for searching:
>
> news = News.objects.filter(
> Q(title__icontains=phrase)
> | Q(tags__icontains=phrase)
> | Q(short__icontains=phrase)
> | Q(content__icontains=phrase)
> | Q(author__icontains=phrase)
> | Q(source__icontains=phrase)
> )
> News
Amit Upadhyay skrev:
> Hi,
>
> You are all aware of object pagination, search results, your photo on
> flickr, stories on reddit, all have a next page/previous page paradigm.
> Django makes it trivially easy to create such pages by providing object_list
> generic view. There are some problems
Stefan Matthias Aust skrev:
>
> Let's assume you have users who are allowed to assign nick names to
> theirselves and still all thoses nick names must be different. This is
> want I call a random ID.
>
If a user assigns it, it is not random, by any definition of random I
can think of.
I do
Greg skrev:
> Derek,
> Ok...I made the change and I'm now getting the error:
>
> TypeError at /rugs/cart/1/4/
> unsupported operand type(s) for +: 'int' and 'Price'
>
> Is 'a['choice'].price' not an Int? It says it is in my model file.
>
No it doesn't - "price" is defined as a ForeignKey to
I cannot seem to get
manage.py runfcgi pidfile=myfile.pid
to work unless I have
daemonize=false
as well. I haven't started investigating what actually happens -
thought I'd hear if I am doing something stupid first.
Django is [EMAIL PROTECTED], Debian Etch, python 2.4.4, flup 0.2126-1
AnaReis skrev:
> Hi all,
> I have a problem when inserting a register into this table that I'm
> working with.
> This table belongs to a MySQL database and the storage engine is
> MyISAM. The database that I'm using is a legacy database and I can't
> change it in any way.
> When I insert a
Daniel Kontsek skrev:
> Hello
>
> I have a web application with 2 views. The first view checks if the
> session dictionary has a 'uid' key - if not it generates an random ID
> and puts it into request.session dict. The second view reads the uid
> from the session dict and creates a Project DB
Nis Jørgensen skrev:
> [EMAIL PROTECTED] skrev:
>
>> OK, fixed the above problem -- figured out that it was related to my
>> setting unique=True on a field. But that raises the larger question...
>>
>> I have a bit of data that may or may not exist... a identifi
[EMAIL PROTECTED] skrev:
> OK, fixed the above problem -- figured out that it was related to my
> setting unique=True on a field. But that raises the larger question...
>
> I have a bit of data that may or may not exist... a identifier on the
> user that not all users will have, but if they DO
omat skrev:
> Thanks for the pointer, Nis.
>
> Model inheritance made my models so much DRYer that it will be hard to
> give up, at least psychologically...
>
> And, except for the managers, it worked just as I would expect, and
> for the managers, it was easy to patch.
>
Just to make sure I
FrostedDark skrev:
> Does anyone have the Greenpeace source code... their svn server has
> been down for over a week now and I would love to take a look at it.
>
It has moved here:
https://svn4.cvsdude.com/greenpeace/custard
Yours
Nis Jørgensen
Currently doing other Dj
wrong?
>
This is by "current" design - subclassing of models is not supposed to
work yet. Here is a writeup of how it will likely work:
http://code.djangoproject.com/wiki/ModelInheritance
Since this is currently not supposed to work
Bryan Veloso skrev:
(I am only commenting on the model (database and Django) in this post -
I don't really know enough about imports to help you with that bit)
> I have 2 models for an MMORPG control panel I'm building. Each set of
> data is within it's own app with related models, etc. So
Russell Keith-Magee skrev:
> Ok. In which case, a Sybase backend will probably hit the same
> problems as the existing MS SQL backend. MS SQL doesn't contain
> support for LIMIT/OFFSET in queries, which Django uses these keywords
> to optimize the results obtained from large queries. (I think
KpoH skrev:
> Hello,
> use PIL (http://www.pythonware.com/products/pil/) for this
>
Note the nice logo in the left sidebar :-)
Nis
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Nis Jørgensen skrev:
>
> What is missing above is creating INSERT/UPDATE/DELETE rules for the
> "entity" view. I hacked together the ones below - they seem to work,
> but there might be subtle points of how this works that I have not
> understood.
>
[...]
Nis Jorgensen skrev:
> Paul Rauch wrote:
>
>> Is there a way to reduce execution time by counting objects?
>>
>> it's even splitted in two queries now, with only 2474487 entries ;)
>>
>> in django I use "model.objects.count()"
>>
>> SELECT COUNT(*) FROM "rainbowtables_hashes":34.552
>>
>>
cesco skrev:
> Hi,
>
> I'm trying to apply the patch given in
> http://code.djangoproject.com/ticket/3297
> using tortoiseSVN on windows but I get the following error message:
>
> The line "Index: " was not found
> Either this is not a diff file or the diff is empty.
>
> The file I downloaded
Joshua D. Drake skrev:
> Nis Jørgensen wrote:
>> [...] anytime a
>> database error occurs, all subsequent calls to the database fails with
>> the error message "ProgrammingError: current transaction is aborted,
>> commands ignored until end of transaction
Hello all
I am using Django 0.96 with postgresql 8.1 and psycopg2. The error
handling does not work as I would expect it to. Specifically, anytime a
database error occurs, all subsequent calls to the database fails with
the error message "ProgrammingError: current transaction is aborted,
65 matches
Mail list logo