On 10/24/06, luxagraf <[EMAIL PROTECTED]> wrote:
>
> Russ-
>
> ah. okay that makes sense. I was assuming that entry_set was a
> contruct itself, but it's actually modelname_set...
Yup.
> So to make it purely abstract, things are working like this:
>
> response_obj = get_object_or_404(Model, para
Russ-
ah. okay that makes sense. I was assuming that entry_set was a
contruct itself, but it's actually modelname_set...
So to make it purely abstract, things are working like this:
response_obj = get_object_or_404(Model, param=value)
response_obj.modelname_set.all().select_related()
and I can
On 10/24/06, luxagraf <[EMAIL PROTECTED]> wrote:
>
> "'Tag' object has no attribute 'entry_set'"
>
> Which I believe means that get_object_or_404 is not finding anything
> to return... and yet the correct tag is being passed in and the error
> reporting shows the value of tag being what it should.
use sqlite. its a file and works like a database, very lightweight.
--~--~-~--~~~---~--~~
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 unsubsc
Hello all,
I'm new to django but I'm figuring things out for the most part. I've
built a simple blog app with entries and tags as a kind of starter
app...
Anyway I'm having a problem with my first attempt at a custom view.
What i want to do is show a list of entries that have a given tag so
I've
Ok; there are a few problems
1) in urls.py, new_dict pushes post_save_redirects to "/invoices/".
However, no URL handler is set up for that url. However, you haven't
hit this problem yet - the main problem is...
2) ticket_form.html doesn't contain a form.theater element. As a
result, submitting
Hi again,
Unfortunately I haven't explained my point well from the beginning but
you've managed to understand where I was going with your last example.
I think you are right. I can always anotate the object with that key
and use it afterwards in the template.
Thanks for your time Russell,
João
O
Russell, thanks for looking into this! See comments & code below.
Tom
Russell Keith-Magee wrote:
>
> - Are you sure that the database has been synced to match the 'with
> foreign key' version of the model? Drop the db and recreate to be
> sure.
Yes, I had done that.
> - What does the developmen
It should be noted that they don't offer shell access; so, while it is
theoretically possible to get Django to run on the Mosso service, you
wouldn't have access to manage.py.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
On 10/24/06, doubtintom <[EMAIL PROTECTED]> wrote:
>
> Similarly for django.views.generic.create_update.update_object. They
> work fine on the cheetsheet model, but when a foreign key is added to
> the Theater model that I made up for testing, changes do not take,
> browser does not forward.
>
> I
Sure, Russ, I'll be more explicit, hopefully less Zen-like.
The cheetsheet model as-is works just as expected with
django.views.generic.create_update.create_object, i.e.
1. url kicks off generic view add to template with empty fields as
expected
2. I enter data, click save
3. I get whisked back t
MerMer,
I think what you are looking for can be found in tutorial 2
(http://www.djangoproject.com/documentation/tutorial2/).
In your case you could probable do:
class UserProfile(models.Model):
def fullname(self):
return "%s %s" %(self.user.first_name,self.user.last_name)
fullna
On Mon, 2006-10-23 at 16:38 +, rp wrote:
>
> These posts are very helpful:
>
> http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model
>
> http://www.b-list.org/weblog/2006/09/02/django-tips-user-registration
>
> Both suggest using OneToOneField instead of ForeignKey:
>
On 10/24/06, doubtintom <[EMAIL PROTECTED]> wrote:
> However, nearly the same model with a foreign key to another model in
> the same app (or project, I've tried it both ways) does not:
Help us help you. What does "does not work" mean? What success did you
have with the cheatsheet model? What pro
On 10/24/06, João Cruz Morais <[EMAIL PROTECTED]> wrote:
>
> What if this filter is being used inside a loop and node is changing all
> the time, which happens to be the case?
> Another loop just to find out if a node is inside a list of nodes is not
> only slower and verbose but also a dumb metho
On 23-Oct-06, at 7:55 PM, Przemek wrote:
> I found django too seem to taste the best. I would be thankful for
> suggestion on where to start (howto's, tutorials, articles
do the tutorial on djangoproject.com. Since you are a longtime python
programmer I guarrantee your website will be up and
# Create the decorator
def decorador(function):
def new_function(*args, **kwargs):
# Do what need do
return function(*args, **kwargs)
new_function.__doc__ = function.__doc__
new_function.__name__ = function.__name__
return new_function
# Then use it
@decorador
def
Yes, you must choose a login to you and try it. Also you can try use
the xchat's help :-) and set some others features. I hope this help.
Marcus
On 10/23/06, Picio <[EMAIL PROTECTED]> wrote:
>
> Hello Marcus,
> now I have XChat running, on freenode server.
> Do I have to register myself somewh
On Oct 23, 10:52 pm, "PoBK" <[EMAIL PROTECTED]> wrote:
Blah, never mind.
Managed to boil it down and get it working...
here's the code if anyone's interested:
### code:
from mod_python import apache
import sys
class UrlRegistry(object):
def __init__(self):
self._patterns = []
Thanks for the input - but I still can't get it to work. With the code
as above I get an error
saying the attribute "self.fullname" cannot be found. When I try
"list_display = ('fullname')
I get the following error
"__str__ returned non-string (type instancemethod)".
MerMer
--~--~---
That is, create/update/delete generic views do not create, update, or
delete on a model (table) with a foreign key within the app or project.
At least I cannot figure out how.
They do, however, work fine on a model with a foreign key to
django.contrib.auth.models.User. I got this from the
http://
Hello Marcus,
now I have XChat running, on freenode server.
Do I have to register myself somewhere to use It?
Picio
2006/10/23, Marcus Mendes <[EMAIL PROTECTED]>:
>
> Hi,
> Just for start, you can use 'xchat'; choose freenode server , set
> nickname to you and try to connect by clicking on 'conn
Sorry to cause misunderstanding.
Anyway, thanks to the great #django channel, I figured this out:
def hack_user(sender, args , kwargs):
sender._meta.admin.list_display=('username', 'email', 'first_name',
'last_name', 'is_staff', 'date_joined')
pass
from django.db.models import signals
f
On Oct 23, 2006, at 10:32 AM, orestis wrote:
>
> Thanks, but that will not do. I want the fields to show up in the
> admin
> list display. I don't want to add any new fields. I just want to view
> more fields in the list, and be allowed to sort on them (eg. to
> sort by
> date of creation etc)
Hello,
I've some code which is duplicated between all my views and it violate
the DRY principle. So, I would like to use the decorators to eliminate
the duplicated code. Does someone has a simple example on how to do
that.
The code I would like to factorise is the following one :
if 'is_logged'
Mosso.com (a Rackspace company) runs a grid hosting service. I talked
to them today and they support Apache with mod_python.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gro
Hi,
Just for start, you can use 'xchat'; choose freenode server , set
nickname to you and try to connect by clicking on 'connect'.
Marcus
On 10/23/06, Picio <[EMAIL PROTECTED]> wrote:
>
> Hello,
> I'm pretty new about freenode and IRC chat in general.
> I'm on UBUNTU 6.06 and I want to participa
On Oct 23, 8:01 pm, "Richard Smith" <[EMAIL PROTECTED]> wrote:
> Hello people,
I've managed to get it working from command line:
# python
Python 2.4.3 (#2, Apr 27 2006, 14:43:58)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information
> When I try to edit with the admin interfaces django raises an error:
>
> Exception Type: OperationalError
> Exception Value: no such column: film_film.proposto_da_id
Explanation: I added field "proposto_da" after creating the db so I
added it
by hand but I didn't realize that django
Hello,
I'm pretty new about freenode and IRC chat in general.
I'm on UBUNTU 6.06 and I want to participate sometimes in
irc://irc.freenode.net/django
Can someone help me to begin (how to, which IRC client..., django
channel specifics issues...)
Many thanks to anyone that have so much patience t
I'm assuming you mean one single value, not one value per entry.
There are a whole bunch of ways you can store an item of data in
python. There's the pickle module, various flat-file database wrappers,
just write it to a file, etc.
But IMHO you are _much_ better off writing it to the database, e
Hello SmileyChris,
On Mon, Oct 23, 2006 at 12:18:24PM -0700, SmileyChris wrote:
> On Oct 24, 7:54 am, Baurzhan Ismagulov <[EMAIL PROTECTED]> wrote:
> > is there a way to quickly choose an entry in a drop-down list? IIUC,
> > this is browser-specific, but perhaps there is some fancy Javascript
> >
Hi Przemek,
Welcome to the Django community!
As Marcus suggested, run through the tutorial on the offficial django
site (in the documentation section).
Then join the official django IRC channel
(irc://irc.freenode.net/django) - it's pretty active and friendly and
you should get questions answered
Yep, it's mainly browser-specific here (mostly if you start typing
while you have focus on the box, it'll go to the relevant entry)
However, Javascript can control the selected element of a select box,
so you could write some script. It seems like a lot of effort for
little gain though (but then a
Hello all,
is there a way to quickly choose an entry in a drop-down list? IIUC,
this is browser-specific, but perhaps there is some fancy Javascript
doing that?
Thanks in advance,
Baurzhan.
--~--~-~--~~~---~--~~
You received this message because you are subscribe
What if this filter is being used inside a loop and node is changing all
the time, which happens to be the case?
Another loop just to find out if a node is inside a list of nodes is not
only slower and verbose but also a dumb method, since we can't even
break as soon as we have a positive response
Django works very well in a multi-server two-tiered environment. (Web +
DB) I'm pretty sure that this was one of the goals of Adrian, et al.
as they developed Django.
As long as your database cluster can handle the traffic, you can keep
adding Django webservers with an outward-facing load-balanc
> urlregistry.py
> 1KDownload
Ignore the attachment... it's old, and wrong.
--~--~-~--~~~---~--~~
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
Hello people,
I'm trying to write a short module to enable me to cleanup my urls.py
a bit since I'm anticipating deployment nightmares.
I'm trying to be a bit clever about this. Since my application is only
going to be used internally, and it's not in a publishing environment,
I've decided to go
On 10/23/06, MerMer <[EMAIL PROTECTED]> wrote:
>
> In the example below I am trying to get list_display to show the the
> "fullname" that was defined in def__str__(self). It's not working.
> Can anybody tell me how I can do it.
>
> Many thanks
>
> MerMer
Try this:
> class UserProfile(models.M
try this:
def _get_full_name(self):
"Returns the person's full name."
return '%s %s' % (self.first_name, self.last_name)
full_name = property(_get_full_name)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
AFAIK, to create instance variables, you have to define them in the
__init__(self) function of your class. Defining them in other methods
will not do.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
Thanks, but that will not do. I want the fields to show up in the admin
list display. I don't want to add any new fields. I just want to view
more fields in the list, and be allowed to sort on them (eg. to sort by
date of creation etc)
--~--~-~--~~~---~--~~
You re
Michael Radziej wrote:
> DavidA:
> >
> > DavidA wrote:
> >> I have some models that look like this
> >>
> >> class Analyst(models.Model):
> >> name = models.CharField(maxlength=20, unique=True)
> >>
> >> class Strategy(models.Model):
> >> name = models.CharField(maxlength=20)
> >> des
Hi Przemek,
I think the best local to get an introduce is www.djangoproject.com
... but you can find something at www.python.org (search by
mod_python). I hope this help.
Marcus
On 10/23/06, Przemek <[EMAIL PROTECTED]> wrote:
>
> Hi, I make my living as a software developer for about 15 years n
These posts are very helpful:
http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model
http://www.b-list.org/weblog/2006/09/02/django-tips-user-registration
Both suggest using OneToOneField instead of ForeignKey:
user = models.OneToOneField(User)
instead of:
user = model
What I meant was that the user cannot login to the administration pages
provided by django.contrib.admin, which does login the user as far as I
can tell
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Hello,
I would like to save some arbitrary data that there's no point in
keeping in a database.
It's just a float number really, that some of my models will use, and
it will be updated using a cron job. It will not presented in a
template, just within some methods of a model.
What the heck, her
In the example below I am trying to get list_display to show the the
"fullname" that was defined in def__str__(self). It's not working.
Can anybody tell me how I can do it.
Many thanks
MerMer
class UserProfile(models.Model):
user=models.OneToOneField(User)
activation_key = models.
I need print a file in binary mode
f = open('python.jpg','rb')
bytes = f.read()
f.close()
print bytes
I can't see any binary code. How to do it?
Thank you very much!!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
I am trying to extend the User Model.
I've created a new app (userprofiles) and added this to my settings.
I've then created the models.py (see below)
At first II tried the following (User, unique=True,
edit_inline=models.TABULAR, num_in_admin=1,min_num_in_admin=1,
max_num_in_admin=1,num_extra_o
Hi,
Most of the tutorials I see talk about creating simple web sites on a
single machine with a single db.
Does anyone have the experience of using django to create web sites
using clusters? For example, in the backend, there is a db cluster, in
the frontend, there are several machines serving u
Hi, I make my living as a software developer for about 15 years now and
python has been my primary programming language since its version
1.5.2. But I've never had any need for html (cgi) programming until
now. Time has come that my client asked for an CRM type of application
with www interface an
I want to add created_by / updated_by fields to my models which work
like auto_now_add=True / auto_now=True fields but instead of
automatically saving the current time they should store the current
user. The problem is that current time is easily available in an model
but the user is assiciated wi
Hi,
I created my own authentication backend which gets users from another
table (webforum). I used
http://www.djangoproject.com/documentation/authentication/#writing-an-authentication-backend
as a starting point and the final backend looks like this:
http://rafb.net/paste/results/gaXtif32.html
N
Simon,
Just a suggestion. Why don't you do a bit of documentation explaining
in detail how the wiki works, and perhaps a tutorial on how you build
it. Expect for some stuff written by James and a few others we have
very little Django real world tutorials
Keith Mallory
On Oct 19, 2:46 pm, "[EMA
Duncan,
Try Dreamhost.com. It's cheap and though they do not officially support
Django, their service is not all that bad.
Jeff Croft has a nice tutorial on setting up Django on DreamHost. And
there are some 30 odd Django powered web sites there
Keith
On Oct 19, 6:07 pm, "DuncanM" <[EMAIL PR
Hi,
I too face the same problem.
The idea is to somehow have the tag for any field and not just
1-2-1 or many-2-many.
We may have to hack the admin page.
Any idea
Keith
On Oct 23, 11:34 am, "Ramdas S" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> How does the attribute default in models work?
>
> I
Just a quick update, I intend to go with webfaction hosting so if there
is anyone out there willing to help me every now and then and wants the
10% affilliation then either reply here or email me directly.
Many thanks to all the suggestions.
DuncanM
On Oct 23, 2:48 pm, "Hollywood Cole" <[EMAIL
On 10/23/06, orestis <[EMAIL PROTECTED]> wrote:
>
> Anyone ?
>
Maybe this is too much, but with it you can extend the User module and
add whatever fields you want:
http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model
Jay P.
--~--~-~--~~~---~--~---
On 10/23/06, Florian Heinle <[EMAIL PROTECTED]> wrote:
>
> I created my own authentication backend which gets users from another
> table (webforum). I used
> http://www.djangoproject.com/documentation/authentication/#writing-an-authentication-backend
> as a starting point and the final backend loo
With Webfaction+Django, you will need the option of long running process for mod_python in Apache. The Shared 2 with 40mb, will be enough to hold you down since you most likely will be developing and testing. By the way, I think its great your using Django as senior a project, I'm doing the same bu
Hi Everyone,
Thanks really much for all those pointers! Templatetags are exactly
what I wound up doing. RossP -- thanks for your blog and example
download code -- saved me to see actual working stuff :)
Cheers,
Seemant
--~--~-~--~~~---~--~~
You received this
Hi RajeshD,
Thanks so much for that explanation. The default = 0 trick worked
exactly right for me. I'll have to add a comment next to that field to
explain about the 0 to the production admins -- but that's a good
headache :)
Ramiro: thanks much to you for your time on this!
Thanks,
Seemant
On 10/23/06, zenx <[EMAIL PROTECTED]> wrote:
>
> Hi, are there any plans to add serialization support to generic views?
It sounds like a good idea to me. There are no specific plans (that I
am aware of) to implement this feature, all the core developers are
pretty busy with their own projects and
sorry, paste expired. try http://www.planet-tiax.de/backend.txt
--~--~-~--~~~---~--~~
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
Hi,
I created my own authentication backend which gets users from another
table (webforum). I used
http://www.djangoproject.com/documentation/authentication/#writing-an-authentication-backend
as a starting point and the final backend looks like this:
http://rafb.net/paste/results/gaXtif32.html
N
Hi again,
And thanks to everyone for their hosting recommendations. I am very
new to Django, I am considering using it to develop my final year
project at university - hence looking for some hosting
Just a quick question as regards to the hosting plans with webfaction.
They have a very helpful
Bruno Desthuilliers wrote:
> The goForm method should definitively be "GET", not "POST".
That's a very good point. I'll add that to the list of things to fix -
that goForm was handling about five things at one stage, but I've been
incrementally cleaning it up and there's no reason why it should
[EMAIL PROTECTED] wrote:
> Hi folks,
>
> Over the past few months I've been building a personal wiki system in
> Django (er... a bit longer than that, it started out pre-MR). It's
> slightly different to the Diamanda wiki (http://www.rk.edu.pl/), in
> that it's more of an integrated system.
>
>
Anyone ?
--~--~-~--~~~---~--~~
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]
For m
Hi, are there any plans to add serialization support to generic views?
I think it won't be difficult to implement it because generic views are
already programmed and they should only get one extra parameter to know
which type of document they have to return (html (default), xml, json).
It's just
On 10/23/06, João Cruz Morais <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> Some time ago I've submitted this filter -
> http://code.djangoproject.com/ticket/2741 - because i thought it was too
> simple and obvious to be left outside the builtin pack.
> Adrian rejected the purposal, and never said
DavidA:
>
> DavidA wrote:
>> I have some models that look like this
>>
>> class Analyst(models.Model):
>> name = models.CharField(maxlength=20, unique=True)
>>
>> class Strategy(models.Model):
>> name = models.CharField(maxlength=20)
>> description = models.CharField(maxlength=80)
>>
Malcolm Tredinnick wrote:
> The way Django handles database connections with sqlite doesn't appear
> to be entirely threadsafe for some subtle reason. The short version is
> that you cannot use mod_python and sqlite together reliably at the
> moment.
Thanks. I already started to think that porti
Julio,
> Sure there is hope.
>
> I haven't found any website that couldn't be made with Django. After
> all, it's about HTTP communication. There are even two websites that
> deal with price comparison in the wiki
> (http://code.djangoproject.com/wiki/DjangoPoweredSites):
>
> http://www.gut
76 matches
Mail list logo