> def save(self):
> if self.stuff !=
> magic_function_that_tells_what_is_in_database_for('stuff')
> do_this()
> super(A, self).save()
This 'magic function' is
self.__class__.objects.get(id=self.id).stuff
if self.stuff != self.__class__.objects.get(id=self.id).stuff:
do_this()
Jacob Kaplan-Moss napisał(a):
>>> Can you share any hints on how to reduce the memory usage in such
>>> situation? The underlying database structure is rather complicated and I
>>> would like to not do all queries manually.
>> At this level -- hundreds of thousands of objects per query -- I doubt
Yep, I should have thought of that. Cheers!
On Jan 31, 7:13 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> > def save(self):
> > if self.stuff !=
> > magic_function_that_tells_what_is_in_database_for('stuff')
> > do_this()
> > super(A, self).save()
>
> This 'magic function' is
>
Am Montag, 28. Januar 2008 10:16 schrieb Alistair Lattimore:
> Thomas,
>
> Do you use a custom manager to select out the row before issuing the
> save to make sure that the in memory timestamp matches that of the
> database?
>
No, since I don't use caching the mtime should be 'fresh'. Since
I use
Am Mittwoch, 30. Januar 2008 16:18 schrieb Michael Hipp:
> Does Django have any built-in way to handle or prevent simultaneous,
> incompatible edits to a database record?
Some days ago there was a thread about optimistic locking:
I wrote an second answer some minutes ago.
http://groups.google.c
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I've had pretty good results with SQLAlchemy on large datasets, that
might be a painless way to solve the problem..
Ben
Jarek Zgoda wrote:
> Jacob Kaplan-Moss napisał(a):
>
Can you share any hints on how to reduce the memory usage in such
Ravi Kumar wrote on 01/31/08 06:45:
> Hi,
> I have developed a Django project with 3 apps. Now, I have to implement
> authentication for 2 apps, while one app will be public without any
> authentication.
> But I don't want to run two virtual servers with HTTP and HTTPS differently.
> The condition
On Jan 31, 2008 2:49 PM, Steven Armstrong <[EMAIL PROTECTED]> wrote:
>
> Maybe something like this in your apache config?
>
> RedirectMatch permanent /(login|securepage) https://www.example.com/$1/
>
>
One idea is to redirect user login to HTTPS in same django apps but in
different apache virtual
Thank you all!
Indeed, it was because I was using Django's internal server
(runserver).
When I tried any other url, it worked.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gro
Hello.
How can I establish the comma ',' as the decimal separator?
Is there any config file where I should set it up?
Thanks.
Mauro.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
> Yes, but I won't know the value of 'foo' until runtime. There's no
> other way to set it? I don't want to hardcode a bunch of entries like
> "self.somefield = whatever" in __init__, either, because I'm trying to
> consolidate a bunch of ad-hoc code into a single inheritable class.
Use fields i
Mauro Sánchez wrote:
> Hello.
> How can I establish the comma ',' as the decimal separator?
> Is there any config file where I should set it up?
> Thanks.
> Mauro.
>
> >
>
>
You should look at the locale configuration
ARIEL
--~--~-~--~~~---~--~~
You received th
Mauro,
On Jan 31, 2008 10:23 AM, Mauro Sánchez <[EMAIL PROTECTED]> wrote:
>
> Hello.
> How can I establish the comma ',' as the decimal separator?
> Is there any config file where I should set it up?
> Thanks.
You can try with the decimalfmt filter of Christopher Lenz's [1]Babel
[2]Django plugin
co sądzicie, czy te http://sporthit.pl/-c-154_162.html";
target="_blank">stroje kąpielowe, okularki pływackie, czepki
pływackie, kąpielówki, stroje pływackie są dobre? jeśli tak to
dlaczego. Czy warto jest wydać tyle kasy na nie?
jednocześnie chciałem się dowiedzieć co sądzicie o firmie Wilson cz
I have a simple model like this:
class Events( models.Model ):
fname = models.CharField( maxlength=100, verbose_name='Firstname' )
lname = models.CharField( maxlength=100, verbose_name='Lastname' )
I would like to add the functionality to be able to manually sort
these objects
When I install Django on Leopard, py files went into:
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
site-packages/django/
And template htmls, etc. went into:
/Library/Python/2.5/site-packages/django/
This resulted in some weird behavior such as templates of contrib
appl
I keep both django versions/branches and projects at the same level.
My directory structure looks like:
django_gis
django_0.97-pre
etc ...
Project1
Project2
etc ...
I symlink then an apropriate django version from within a project as
"django". This allows me flexibility in both switching python
> Use fields instead of base_fields :
>
> 1.
> class TestForm(forms.Form):
> def __init__(self, *args, **kwargs):
> super(ArrivalForm, self).__init__(*args, **kwargs)
> self.fields['somefield'].label = 'foo'
>
> somefield = forms.IntegerField()
Yells "d'oh!" and slaps foreh
Thomas Guettler wrote:
> Am Donnerstag, 24. Januar 2008 13:08 schrieb Tim Sawyer:
>> Hi Folks,
>>
>> I'm just evaluating django for use on a project. I have a multiuser
>> application where many users can be changing data at once.
>>
>> What's the status of hibernate style optimistic locking, whe
On 1/31/08, Nianbig <[EMAIL PROTECTED]> wrote:
> I would like to add the functionality to be able to manually sort
> these objects in the Django-admin... I´ve tried doing this by just
> adding a integerfield... but it is not so user friendly... are there
> any built-in functions for this in Django
Dear All,
I've copied a MySQL db (using mysqldump) and then loaded it into a new
DB. I've also altered the structure slightly (I've added 6 columns).
However, the problem is that when I try and use the db to add more
data, the primary key starts from 0 again. Since the number for the
first curre
when typing "/bin/make-messages.py -l de" from within my app-
directory, I get this error:
errors happened while running xgettext on __init__.py
/bin/sh: line 1: xgettext: command not found
"which gettext" tells me that gettext is installed.
any ideas?
thanks,
patrick
--~--~-~--~~
Thomas Guettler wrote:
> Am Mittwoch, 30. Januar 2008 16:18 schrieb Michael Hipp:
>> Does Django have any built-in way to handle or prevent simultaneous,
>> incompatible edits to a database record?
>
>
> Some days ago there was a thread about optimistic locking:
> I wrote an second answer some m
On Jan 31, 11:15 pm, Thomas <[EMAIL PROTECTED]> wrote:
> I keep both django versions/branches and projects at the same level.
> My directory structure looks like:
>
> django_gis
> django_0.97-pre
> etc ...
> Project1
> Project2
> etc ...
>
> I symlink then an apropriate django version from within
> I'd like to override the save() method and within it I'd like to test
> if a value has changed, that is, if that value as stored in the
> object (in memory) is different from what is actually stored in
> database.
Another approach is using __getattr__ to monitor changes. It saves you a
qu
On 31 Jan, 16:52, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]>
wrote:
> On 1/31/08, Nianbig <[EMAIL PROTECTED]> wrote:
>
> > I would like to add the functionality to be able to manually sort
> > these objects in the Django-admin... I´ve tried doing this by just
> > adding a integerfield... but it is
Hi django users,
I have 2 db-classes:
class Writer(models.Model):
name = models.CharField(max_length=255, unique=True)
class Admin:
pass
def __unicode__(self):
return self.name
class Book(models.Model):
name = models.CharField(max_length=255, unique=True)
wri
Installed the latest Django package from the Synaptic package manager
on Ubuntu 7.10. I understand the Django version to be 0.96.1 (package
says 0.96-1ubuntu0.1).
I'm on the first django tutorial:
http://www.djangoproject.com/documentation/tutorial01/
Got my sqlite database set up. Now trying t
> Could you explain how this works, please?
>
> It looks - to my uneducated eyes - if this leaves open a potential race
> condition where the mtime field could yet be changed in the database by
> another process within the "decision time" of this method. Do I
> misunderstand? It seems to me that t
Hello,
> But I thought sqlite3 came along with Python 2.5. No?
>
> Any clues to what am I missing here? Need to install something else?
> Path problems?
> Generic newbiness?
I don't think so. Anyway, it is as simple as installing package
"sqlite3" on your Ubuntu. If it's already there, even be
def save( self ):
if self._get_pk_val():
old = MyModel.objects.get( pk = self._get_pk_val() )
if self.field != old.field:
print "Values do not match"
super( MyModel, self ).save()
On 31 янв, 10:54, Julien <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I'd like to ove
Hello,
An unrelated note to your question...
If you are using 0.96, you need to use the 0.96 docs.
http://www.djangoproject.com/documentation/0.96/
The link you pasted assumes you are using the development version, which
has some differences. My personal recommendation is to remove 0.96 and
Hi,
i'd like to make an application that should execute commands with
permission that are not normally for www-data (eg: create user). Of
course
I know I could use sudo and execute the command via subprocess or
similar. But it happens that the command is a python script so i'd
prefer
to
Hello,
I'm trying to write simple blog tool but I ran into some problems. I
would like to attach multiple images to a post. Here's my models:
class Entry(models.Model):
title = models.CharField(max_length=200)
date = models.DateTimeField(auto_now=True)
body = models.TextField()
class
Hey,
I was wondering if anyone had a neat way to take a list of errors
created in a template view and put it into an error box that would pop
up over the webpage should the user cause an issue. Any help would be
appreciated. Thanks for your time.
Jacob
--~--~-~--~~~---~
Would the user messaging system work for you?
http://www.djangoproject.com/documentation/authentication/#messages
On Jan 31, 2008 12:33 PM, jacoberg2 <[EMAIL PROTECTED]> wrote:
>
> Hey,
> I was wondering if anyone had a neat way to take a list of errors
> created in a template view and put it in
The design pattern is a toaster popup. You can achive this using CSS
+ JavaScript, for example with jQuery. For example, you could use
this CSS to hide your message area:
.messages {
position:absolute;
z-index:5;
top: -300px;
left: 300px;
width: 250px;
margin: 0 auto;
height:1
On Jan 31, 10:38 am, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> The link you pasted assumes you are using the development version, which
> has some differences. My personal recommendation is to remove 0.96 and
> use django-svn.
You are correct. I just tried some of the tutorial steps that
determ
Well im using that API for an error message already, it doesn't create
a new box,
but it lists the error underneath the form. I am going to have long
lists of
names that i would like to display in an orderly fashion, and listing
them in a
box with the error message seems like the best method to me
On Jan 31, 2008 2:27 PM, bobhaugen <[EMAIL PROTECTED]> wrote:
>
> Installed the latest Django package from the Synaptic package manager
> on Ubuntu 7.10. I understand the Django version to be 0.96.1 (package
> says 0.96-1ubuntu0.1).
>
> I'm on the first django tutorial:
> http://www.djangoproject.
When trying to send email to one user it seems that the send_mail
command takes about 6 seconds.
Does anyone have any suggestions on how to improve the response time.
Also, it seems consistent whether or not I use the development
environment or my production web site.
Thanks,
Jeff
--~--~---
I am trying to get a handle on how to configure django/reviewboard
under mod_python.
I want to setup reviewboard not in the root directory but a sub
directory say /reviews/
I saw the comment:
Note
If you dep
I have a blog that has a slug field that gets pre-populated from the
title of the blog. I then use the slug name as a part of the url. eg -
www.xyz.com/weblog/weblog-title-goes-here/. My question: what if I
have a weblog title that is identical to a post that I made 3 years
ago and I didn't realiz
Found this... http://www.djangosnippets.org/snippets/512/
On Jan 31, 1:50 pm, Chris <[EMAIL PROTECTED]> wrote:
> I have a blog that has a slug field that gets pre-populated from the
> title of the blog. I then use the slug name as a part of the url. eg
> -www.xyz.com/weblog/weblog-title-goes-her
> My question: what if I
> have a weblog title that is identical to a post that I made 3 years
> ago and I didn't realize it? when saving, is the slugfield smart
> enough to acknowledge that there is a duplicate entry.
The slug field itself doesn't force uniqueness, but you can use
"unique=True"
On Feb 1, 4:27 am, sandro dentella <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i'd like to make an application that should execute commands with
> permission that are not normally for www-data (eg: create user). Of
> course
> I know I could use sudo and execute the command via subprocess or
> sim
Cool Thanks for the replies. I think that Luke's snippet find is going
to work. Unique is also a good way thanks.
On Jan 31, 5:15 pm, "James Punteney" <[EMAIL PROTECTED]> wrote:
> > My question: what if I
> > have a weblog title that is identical to a post that I made 3 years
> > ago and I didn
On Feb 1, 2:05 am, omat <[EMAIL PROTECTED]> wrote:
> When I install Django on Leopard, py files went into:
> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
> site-packages/django/
If you are running Python 2.5.1 that ships with Leopard,then the
directory:
/System/Libra
On Thu, Jan 31, 2008 at 02:30:02PM -0800, Graham Dumpleton wrote:
>
> On Feb 1, 4:27 am, sandro dentella <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > i'd like to make an application that should execute commands with
> > permission that are not normally for www-data (eg: create user). Of
> > cou
dear list,
let's say i have many tagged items (eg images or bookmarks). if i
select one of them, and then i select a tag of the item, i would like
to find all the items with this tag (including the selected one) and
make a histogram out of the tags of found items (exluding the selected
one), ie t
I've been reading up on user permissions and I have found that user
permissions are on a per-model basis. My question: If I have a photo
gallery application, and I have several uses who can post their
galleries to this application. Is there a way to create permission on
a per-user basis. Example m
On Feb 1, 9:46 am, Alessandro Dentella <[EMAIL PROTECTED]> wrote:
> On Thu, Jan 31, 2008 at 02:30:02PM -0800, Graham Dumpleton wrote:
>
> > On Feb 1, 4:27 am, sandro dentella <[EMAIL PROTECTED]> wrote:
> > > Hi,
>
> > > i'd like to make an application that should execute commands with
> > > pe
I had the same problem.
I think the problem is that you are referencing a non-existent (view)
function named 'viewer' in your urls.py. This wasn't a problem in
previous versions, but with the addition of the reverse url lookup,
non-existent views now cause problems.
What I gather is happening is
No, just now django doesn't support row level permissions.
Look at this branch http://code.djangoproject.com/wiki/RowLevelPermissions
On 1 фев, 02:06, Chris <[EMAIL PROTECTED]> wrote:
> I've been reading up on user permissions and I have found that user
> permissions are on a per-model basis. My
> gallery application, and I have several uses who can post their
> galleries to this application. Is there a way to create permission on
> a per-user basis.
There apparently was some work on a per-object permissions branch in the
past, but it looks pretty dead:
http://code.djangoproject.co
Hi, I have had some problms installing Django in Windows XP. I have
finally got it to work, in a fashion. I can go to the command prompt
and type "django-admin.py startproject mysite" I set path variables,
etc so this command is semi-valid. The only problem is that instead of
creating a 'mysite' f
newforms is great for creating forms. I need something similar to generate a
display form from a model.
I looked at subclassing form, but what I would need to override is in the
widgets. which is probably why my hope isn't a good one. but for what I need,
I only am using char fields, so I d
Using SVN you could SVN use modelforms, on .96 use the form_for
helpers.
On Jan 31, 6:34 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
> newforms is great for creating forms. I need something similar to generate a
> display form from a model.
>
> I looked at subclassing form, but what I would need
[EMAIL PROTECTED] wrote:
> Using SVN you could SVN use modelforms, on .96 use the form_for
> helpers.
but modelforms still puts everything in tags, right?
Carl K
>
> On Jan 31, 6:34 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> newforms is great for creating forms. I need something similar
On Jan 31, 2008 5:06 PM, Chris <[EMAIL PROTECTED]> wrote:
> I've been reading up on user permissions and I have found that user
> permissions are on a per-model basis. My question: If I have a photo
> gallery application, and I have several uses who can post their
> galleries to this application.
hey Guys,
* warning: this is a beginner question!
I created a django project and a simple app... I added a simple class
in models.py (I put in an inner Admin class), synced the db, and
visited the admin page...
however, I cannot see a field on the admin page related to my new
class... only the
You'll need to paste some code so we can see the problem.
Debugging advice: Double check everything!
Jeff Anderson
aym35 wrote:
hey Guys,
* warning: this is a beginner question!
I created a django project and a simple app... I added a simple class
in models.py (I put in an inner Admin class),
Is your app in the installed apps list in settings?
On Jan 31, 8:46 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> You'll need to paste some code so we can see the problem.
> Debugging advice: Double check everything!
>
> Jeff Anderson
>
> aym35 wrote:
> > hey Guys,
>
> > * warning: this is a beg
Yes, I suppose if you wanted you could create a custom form that added
the attribute disabled to all of them, however I am not aware of any
other way, someone else might be able to explain how to alter all the
fields in the __init__ method but I'm not sure how.
On Jan 31, 7:13 pm, Carl Karsten <
Did it actually add tables for that app when you synced the db? Did
you add the app to your INSTALLED_APPS?
On Jan 31, 8:44 pm, aym35 <[EMAIL PROTECTED]> wrote:
> hey Guys,
>
> * warning: this is a beginner question!
>
> I created a django project and a simple app... I added a simple class
> in
I am not sure I understand your setup. What is the world is /
dashboard/? Why is Apache looking for that?
What is the path of your reviews project? Is it actually in /var/www/?
On Jan 31, 3:00 pm, pouakai68 <[EMAIL PROTECTED]> wrote:
> I am trying to get a handle on how to configure django/revi
I have a view that works something like this:
def graph_search(request):
g = build_graph()
result = search_graph(g, some_parameters_from_request)
return render_to_response('template.html',{'result': result})
build_graph() queries the DB and builds the graph in memory, which
takes about
I found that the problems comes because I am using a middleware of
perform_bench... so no problem here, just write this info. in case any
other people falls the same trap. ;)
On Jan 13, 2:41 pm, pength <[EMAIL PROTECTED]> wrote:
> Thanks for your reply.
>
> I am using MySQL 5.0.24, with InnoDB en
I've been trying unsuccessfully to implement a file-upload form.
I put up the code from models.py, forms.py, and views.py, as well as
the form template code and the generated form html at . I'd appreciate and welcome pointers to where
I'm going wrong.
Relevant info...
- When I add a file from t
Is there a built in way for users to update their own user record?
I currently have a page that displays user data to any other user. I was
hoping
to re-use that for allowing a user to edit his own.
If it matters, I am useing a user_profile as described:
http://www.b-list.org/weblog/2006/jun/
This is kind of an extension of an earlier (mostly unresolved) issue I
had brought up here:
http://groups.google.com/group/django-users/browse_thread/thread/63beb7566dc352a8/1e6e137f5b5a434a
Here's my current url conf (I've commented out everything else):
url(r'^(johndoe|janedoe)/$', 'translator
Hi,
Thank you for all the information, it seems like you think it easy to
do, as everyone accept to help me for free :-)
The solution used before was to send to encrypted string in clear in a
email. It used a perl impletation of the one-time pad.
Emanuele, your said : As for safety, nothing is
Hi,
I am using the following in my Image model:
file = models.ImageField(upload_to='/%y/%m/%d')
I want every image to be uploaded in the users directory like '//
%y/%m/%d' instead of all files in default location.
Is it possible ?
Thanks
--~--~-~--~~~---~--~~
You
Am Freitag, 1. Februar 2008 07:57 schrieb django_user:
> Hi,
> I am using the following in my Image model:
> file = models.ImageField(upload_to='/%y/%m/%d')
>
> I want every image to be uploaded in the users directory like '//
> %y/%m/%d' instead of all files in default location.
>
> Is it possibl
is just a sample.. I want auth.user.username there...
On Feb 1, 12:16 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> Am Freitag, 1. Februar 2008 07:57 schrieb django_user:
>
> > Hi,
> > I am using the following in my Image model:
> > file = models.ImageField(upload_to='/%y/%m/%d')
>
> > I wan
Am Freitag, 1. Februar 2008 06:53 schrieb Eric Abrahamsen:
> This is kind of an extension of an earlier (mostly unresolved) issue I
> had brought up here:
> http://groups.google.com/group/django-users/browse_thread/thread/63beb7566d
>c352a8/1e6e137f5b5a434a
>
> Here's my current url conf (I've com
http://www.technocrafter.com
--~--~-~--~~~---~--~~
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 [EMAI
Hi list! (first post)
I've created a small application to suit a new project I am working on,
however I have a question regarding using the user profile feature. I
have the setup working properly according to the documentation and it
works, what I need to know is if I can create a field in my
Hello,
On my Debian Lenny box, with Python 2.5.1, I have the following error
the first time I generate a page. When I refresh the page, I have the
normal output (ie listing css, html, images files)
Traceback (most recent call last):
File
"/usr/lib/python2.5/site-packages/django/core/serve
79 matches
Mail list logo