New Django user here with a question about the client side: Is there
built-in support for dealing with concurrent edits? I'm not referring
to the database issues (locking, etc) but is there Django support for
handling a request to access or edit data for which another user is
editing?
I'm thinkin
On Aug 20, 2:50 pm, Alex Gaynor wrote:
> On Thu, Aug 20, 2009 at 1:46 PM, Abiel wrote:
>
> > Is there an efficient way to use Django models to load a large number
> > of records into a database without falling back on raw SQL? Creating a
> > large number of model objects and then saving each one
ewrite what I have as raw SQL, I am just looking for
anything that I can do, such as turn off indexing, write to the db in
batches, or similar django-level optimizations.
I don't think what you mentioned can help in this situation, right?
-Doug
>
> - Benjamin
>
>
>
>
>
On Fri, Aug 21, 2009 at 4:22 AM, luca72 wrote:
>
> I have solved using :
> Model.object.filter(id=2)values('columnname')
>
Note that it should have a dot:
Model.object.filter(id=2).values('columnname')
and that returns the item you want in a list. The proper way to do that is:
Model.object.ge
On Sat, Aug 22, 2009 at 12:24 PM, ringemup wrote:
>
> Has anyone here ever written an application that needed to be able to
> take a date field where the month or day was sometimes but not always
> known? How would you handle this? Using separate day/month/year
> fields instead of a DateField s
On Mon, Sep 14, 2009 at 7:17 AM, Nicola Manica wrote:
> Hi, I'm a student that try to learn geodjango.
> I have the following code in one view:
> ...
> for t_path in path.the_geom:
> print t_path.json
> print t_path.wkt
> print t_path.kml
> ...
>
> path.the_geom is a multilinestr
I'm trying to use django without resorting to setting the environment
variable, by doing this:
from django.conf import settings
import mysettings
settings.configure(mysettings, DEBUG=True)
The mysettings.py originally just contained those in the default
settings.py file.
However, I keep getting
On Tue, Oct 13, 2009 at 10:06 PM, Doug Blank wrote:
> I'm trying to use django without resorting to setting the environment
> variable, by doing this:
>
> from django.conf import settings
> import mysettings
> settings.configure(mysettings, DEBUG=True)
>
> The
On Wed, Oct 21, 2009 at 5:12 AM, Arthur Metasov wrote:
>
> 2009/10/21 valler <180...@gmail.com>:
>>
>> Hello. I want to know, if something like that possible:
>> MyModel.objects.filter(name__contains='foo',status__exact='bar') =>
>> It's OK.
>>
>> But I want to use dynamic keyword generation, li
Django users,
I have data that needs to be handled in two different manners,
depending on if the user has certain permissions or not. For example,
if a record is marked "private" and a user is not permitted, I want to
substitute the word "PROTECTED" for a particular field's value.
Now, of course
have to worry that the value of
fieldname will ever accidentally not be protected as this is the only
way to get it.
See any problems with this (other than taking a small hit on every
field access)?
-Doug
> On Nov 18, 4:17 pm, Doug Blank wrote:
>> Django users,
>>
>> I have da
I'm filling my Django tables with data through a regular Python
program (not through the browser). After it runs for a few hours, I
get:
10557896: ERROR: gramps.py: line 121: Unhandled exception
Traceback (most recent call last):
...
event = models.Event.objects.get(handle=ref)
File "/usr/
On Fri, Nov 20, 2009 at 6:32 AM, Doug Blank wrote:
> I'm filling my Django tables with data through a regular Python
> program (not through the browser). After it runs for a few hours, I
> get:
>
> 10557896: ERROR: gramps.py: line 121: Unhandled exception
> Traceback
On Fri, Nov 20, 2009 at 10:22 PM, Karen Tracey wrote:
> On Fri, Nov 20, 2009 at 6:19 PM, Doug Blank wrote:
>>
>> Some additional data:
>>
>> I'm using Django 1.1 on Fedora11 with sqlite backend. I get the same
>> kind of spiking of memory usage if I ju
On Sat, Nov 21, 2009 at 7:44 AM, Doug Blank wrote:
[snip]
> It does seem that:
>
> Table.objects.all().delete()
>
> is "leaking" memory (eg, continues to use memory) and is very slow.
> I'm trying to find a better (faster, less memory) method similar to
> th
On Mon, Nov 23, 2009 at 7:16 AM, gentlestone wrote:
> why this piece of code doesn't work?
>
> {% for field in form|slice:":2" %}
>
> the result is iterating over all fields, not just the first two fields
Perhaps break this up into two parts?
{% with form|slice:":2" as formslice %}
(% for fi
On Mon, Nov 23, 2009 at 9:09 AM, lfrodrigues wrote:
> I guess this solution works but for +50 the performance should be
> terrible...
>
> Shouldn't django have some option for this?
Could you set a field's value which is true for one, and false for the
other? Otherwise, could you just have tw
On Fri, Dec 4, 2009 at 3:44 PM, Daniel Roseman wrote:
> On Dec 4, 8:37 pm, Phlip wrote:
>> Django users:
>>
>> I only ask the question to help improve my esthetics, but others might
>> need a performance boost here.
>>
>> How to delete every record in a table?
>>
>> A related question - how to de
On Thu, Nov 26, 2009 at 6:01 AM, Tom Evans wrote:
> On Thu, Nov 26, 2009 at 2:35 AM, fallhunter wrote:
>>
>> i have this code in my tests.py:
>>
>> from models import *
>>
>> and in the models.py I have a signal handler and register it with
>>
>> post_save.connect( post_save_note, sender=Note )
>
Django users,
I'm wrestling with how to best create HTML pages that can either be
used for displaying or editing data. That is, I'd like the field's
values to appear as text in display mode, but in their widgets when in
edit/add mode. It appears that Django wasn't designed to do this: the
fields a
put a filter in the
template. That way, I'll have all of the elements there (errors,
display information) for all of the modes (display, edit, and add).
I'll see how far I can go with this method before having to resort to
a more substantial widget-swap.
It does seem that this is an area
On Mon, Dec 21, 2009 at 8:10 PM, Justin Steward wrote:
> Hi all,
>
> I've written a custom command to use with manage.py, and from the root
> of the project directory, it works great.
>
> But the problem is, this command is almost never going to be called
> from within the project directory.
>
> (
On Wed, Dec 23, 2009 at 11:15 AM, TiNo wrote:
> On Wed, Dec 23, 2009 at 16:53, Bill Freeman wrote:
>>
>> Are you sure that Lid is defined in this context? Try putting:
>>
>> import pdb;pdb.set_trace()
>>
>> before the super and check.
>
> As I described, I checked that. The strange thing is, tha
On Tue, Dec 22, 2009 at 2:21 PM, neridaj wrote:
> I'm trying to add a get_absolute_url method to a Tweet model from
> django-syncr and do not understand why the method is not recognized.
>
> class Tweet(models.Model):
> pub_time = models.DateTimeField()
> twitter_id = models.PositiveInte
On Mon, Aug 16, 2010 at 7:23 AM, Mark Mooij wrote:
> Allright I tried a couple of things with your suggested appraoch:
>
> - I printed all the strings used to define paths and files, this all
> seems correct.
>
> - The os.mkdir() command is passed without raising an error, but
> without creating t
tly 1 argument
> (2 given)"), but again outside Django this works just fine..
Ok, that is very suspicious. It sounds like there is another os module
that you are somehow getting, rather than the Python system one.
Perhaps have a look at os.__file__ to see if that is the correct
version.
-Doug
On Mon, Aug 16, 2010 at 8:51 PM, Mike Dewhirst wrote:
> On 16/08/2010 10:22pm, Doug Blank wrote:
>>
>> On Mon, Aug 16, 2010 at 7:23 AM, Mark Mooij wrote:
>>>
>>> Allright I tried a couple of things with your suggested appraoch:
>>>
>
>
On Wed, Dec 30, 2009 at 6:24 PM, gintare wrote:
> Hello,
>
> In short
> OS Debian Gnu Linux Lenny
> Python 2.5
> Installed Django-1.1.1.tar.gz,
> /usr/lib/python-django/Django-1.1.1/docs/intro/tutorial01.txt
>
> command python manage.py sql polls
> gives error: IndentationErro
On Wed, Dec 30, 2009 at 11:54 PM, malik wrote:
> I heard that that multi DB support is now available in Django.Can some
> one tell me whether it is possible to have foreign Key across
> Databases.
>
>
Please see this thread:
http://groups.google.com/group/django-users/browse_thread/thread/74bcd1
On Sun, Jan 24, 2010 at 1:05 PM, mehdi0016 wrote:
> hi
> i'm new with python and django and i work on search page of my site.
> in my html search form, user can choose table(or field) which want to
> search. in server-side i use sequences of 'if' to find chosen table(or
> field) and related djang
On Thu, Jan 28, 2010 at 3:53 PM, Saravanan wrote:
> I have Django installed in SUSE Linux with postgres. It is working
> great. Kudos
> I have an issue. I have total database structure containing more than
> 100million rows. I have partitions and indexes. It is taking plenty of
> time to load
On Tue, Jul 31, 2012 at 3:15 AM, JJ Zolper wrote:
> Hello all,
>
> I didn't realize a new release was put out until something weird happened.
>
> I'm installing DJ on my production server now and when I was downloading a
> copy from https://www.djangoproject.com/download/
On that same page (optio
Django users,
We are using Django for two purposes: its ORM for a single-user desktop
app, and for a regular Django webapp.
For the desktop ORM, is there a way to switch between different
settings.py? For example, we'd like to be able to load the default
settings, but then later unload everything
eed to reset the
Django initialization in a Python session.
-Doug
>
> David
>
>
> Am 11.05.2015 um 18:17 schrieb Doug Blank:
>
> Django users,
>
> We are using Django for two purposes: its ORM for a single-user desktop
> app, and for a regular Django webapp.
>
> For
ckpoint.py
import sys
class ModulesCheckpoint(object):
def __init__(self):
self.original = sys.modules.copy()
def reset(self):
# clear modules:
for key in list(sys.modules.keys()):
del(sys.modules[key])
# load previous:
for key in self.origin
On Wed, Nov 27, 2013 at 2:58 PM, Pau Creixell wrote:
> Hi there!
>
> I am trying to run jobs in the background using the following (minimal)
> code:
>
> Under views.py:
>
> def submit(request):
>model = MyModel()
>model.RunInAThread(ReferenceSeparator, MutationSeparator)
>
> Under models.p
On Fri, Dec 20, 2013 at 11:45 AM, Mario Osorio wrote:
> I need to work on a django app that will eventually benefit from a RESTful
> API so it can be used from any web browser as well a from apps writtens for
> iOS and Android.
>
> Being so new to django development I don't even have any ideas on
37 matches
Mail list logo