This won’t solve your problem but tangentially I’ve made a custom field
lookup for `relatedfield__neq=objectToExclude`
See:
https://docs.djangoproject.com/en/5.1/howto/custom-lookups/
On Tue, Oct 15, 2024 at 3:59 PM Ben Pearman
wrote:
> Hi all,
>
> We wrote some custom logic that extended the `
Thank you too Adam.
Great stuff!
On 4/9/20 7:43 AM, Adam Mičuda wrote:
Hi,
you can also write simple python script and run it in Django context
via
https://django-extensions.readthedocs.io/en/latest/runscript.html from
`django-extensions` package.
Best regards.
Adam
čt 9. 4. 2020 v 17:14
Hi,
you can also write simple python script and run it in Django context via
https://django-extensions.readthedocs.io/en/latest/runscript.html from
`django-extensions` package.
Best regards.
Adam
čt 9. 4. 2020 v 17:14 odesílatel Tim Johnson napsal:
> Thank you Andréas. I have come across that t
Thank you Andréas. I have come across that too, after my OT.
This is definitely what I was looking for.
cheers
On 4/9/20 2:05 AM, Andréas Kühne wrote:
Hi Tim,
What you probably should do is use a custom command on the manage.py
command interface. You till then get access to all of djangos go
Hi Tim,
What you probably should do is use a custom command on the manage.py
command interface. You till then get access to all of djangos goodness -
and it can be run from the command line.
See here:
https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/
This is how I would han
Hi We are worlds first affordable Python, Django Based Commpany,
And can help you in this and related tasks / projects immidiately mere at
$7 per hour
Best Regards,
Divyesh Khamele,
Pythonmate
On Sun, 1 Dec 2019 at 19:39, bill dexter <55dexte...@gmail.com> wrote:
> ELECT a.matr
> ,[nom]
>
Hi issuer,
Plz refer to docs to customize statement base on your use case, my work for
a sample with limited time. Plz try remove space around equal sign.
On Tue, Dec 3, 2019, 19:26 bill dexter <55dexte...@gmail.com> wrote:
> hi friend;
> i tryed your answer, but it says that error in syntax n
hi friend;
i tryed your answer, but it says that error in syntax near __gt in ""
extractyear(dat_enc) - extractyear(annee)__gt = 3""; don't work
Le lun. 2 déc. 2019 à 20:31, Integr@te System a
écrit :
> Hi friend,
>
> All_list = list(users.object.aggregate(age =
> cast(extractyear(datetime.now
Hi friend,
All_list = list(users.object.aggregate(age =
cast(extractyear(datetime.now()) - extractyear(dat_nais), output_field =
IntField())).filter(extractyear(dat_enc) - extractyear(annee)__gt = 3
& extractyear(datetime.now())
- extractyear(dat_nais)__IN=range(54,70) & cod_nad__contain =
'CN').o
thank you, but if you can give me answer to this exacte probleme, as
mentioned in question
Le dim. 1 déc. 2019 à 18:55, Integr@te System a
écrit :
> Hi,
>
> here u can try for complex queryset
>
>
>
> https://docs.djangoproject.com/en/2.2/topics/db/queries/#complex-lookups-with-q
>
> On Sun, De
Hi,
here u can try for complex queryset
https://docs.djangoproject.com/en/2.2/topics/db/queries/#complex-lookups-with-q
On Sun, Dec 1, 2019, 21:08 bill dexter <55dexte...@gmail.com> wrote:
> ELECT a.matr
> ,[nom]
> ,[prn]
> ,cast([dat_nais] as date) as dat_nais
> , (YEAR(ge
Most tools are capable of exporting uml to code format. A little googlin
should help.
ma 16. syysk. 2019 klo 18.57 Yann Mbella
kirjoitti:
> I needed the contrary having uml diagrams and generating models from
> does diagram
>
> Le lun. 16 sept. 2019 à 16:43, Yann Mbella a
> écrit :
>
>> Thanx f
I needed the contrary having uml diagrams and generating models from
does diagram
Le lun. 16 sept. 2019 à 16:43, Yann Mbella a
écrit :
> Thanx for the information
>
> Le ven. 13 sept. 2019 à 06:24, Jani Tiainen a écrit :
>
>> Hi.
>>
>> There exists django-extensions package that has management
Thanx for the information
Le ven. 13 sept. 2019 à 06:24, Jani Tiainen a écrit :
> Hi.
>
> There exists django-extensions package that has management command to make
> UML diagram for your models.
>
>
> pe 13. syysk. 2019 klo 5.22 Yann Mbella
> kirjoitti:
>
>> Got little problem is it possible t
Hi.
There exists django-extensions package that has management command to make
UML diagram for your models.
pe 13. syysk. 2019 klo 5.22 Yann Mbella kirjoitti:
> Got little problem is it possible to have a plugin which mapps or
> reproduce my class diagrams drawn in an IDE of UML in my models a
Hi,
On this question only I took some step deep and able to find out one part
and need your help on the second half.
This requires a good understanding of Django annotation and subquery
features
If you have this thank for reading and helping me in advance
I am facing problem to filter calls on acco
Account /Lead Model
account_name
contact m2m realtion
contact Model
name
phone No
calls Model
caller no # person phone no who is calling
agent no # person who is picking the call (CRM user)
status
timestamp
duration
calls model is populated with so
Right now its an open ended question.
If you post code for your models here, someone can help you.
On Thu, Jun 6, 2019, 4:38 PM Devender Kumar wrote:
> Hi,
> I am working on CRM project and stuck with REPORTING part.
>
> I have Accounts , Lead , contact, Calls ,Concern modules
> account/Lead ca
*From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *b...@tanners.org
> *Sent:* Monday, May 6, 2019 12:44 PM
> *To:* Django users
> *Subject:* Re: ORM help with INNER JOIN and GROUP BY
>
>
>
> Just want to make sure I understand. ForeighKeys need
class Monolithic(models.Model):
facepng_id = models.IntegerField(blank=True, null=True)
facepng_id as Integer not ForeignKey?
> UPDATE items_monolithic SET facepng_id=items_monolithic.id FROM
items_monolithic INNER JOIN items_facepng ON
items_monolithic.object=items_facepng.obj ;
Error: near
Maybe that was a typo?
The foreignkey relationship would look like this:
object = models.ForeignKey(FacePng'', max_length=128, blank=False,
null=False, unique=True)
On Mon, May 6, 2019 at 12:44 PM wrote:
> Just want to make sure I understand. ForeighKeys need to be integers?
>
> Only integers?
: Re: ORM help with INNER JOIN and GROUP BY
Just want to make sure I understand. ForeighKeys need to be integers?
Only integers?
You need a ForeignKey relationship between the two models, which is an integer
value, not a char. You’d have to do migrations to get this adjusted properly.
--
You
Just want to make sure I understand. ForeighKeys need to be integers?
Only integers?
You need a ForeignKey relationship between the two models, which is an
> integer value, not a char. You’d have to do migrations to get this adjusted
> properly.
>
--
You received this message because you a
The field within your class should be set to ForeignKey.
Try this:
Object = models.ForeignKey(‘FacePng’, on_delete=SET_NULL, max_length= some_int)
on_delete and max_length need to be set based on your requirements
Sent from my iPhone
> On May 6, 2019, at 11:28 AM, b...@tanners.org wrote:
>
>
That design could definitely be improved, and it will have to be in order to
use the ORM effectively. Then you’d have to change every reference to the
fields in all the raw querysets in the app.
You need a ForeignKey relationship between the two models, which is an integer
value, not a char. Yo
As suggested i'm writing what i've already tried:
Raw SQL using the query written in the first message, selecting only the id
field and passing it to the ORM as id__in=ids. Slow as hell, unusable.
Declared a WIndow function to use as filter:
Article.objects.annotate(max_rev=Window(expression=Ma
This should be a bug. Most databases don’t even allow foreign keys to be a
different type. I didn’t see anything in the docs about this, but it should
happen automatically. There are several examples of using non-int fields, e.g.
UUID. Can you provide your migration file for OmEvent and mode
Hey,
'case_id' is a monkeypatch number(*) field so it works quick for now, not a
pk, but unique:
class OmEvent(Model):
case = ForeignKey('CaseInfo2', to_field='case_id', related_name='events',
blank=True, null=True)
class Meta:
db_table = 'om_event'
old form:
class OmEve
Please, post your models in question. It's probably something really
simple to resolve in general.
On 21.11.2017 15.59, Avraham Serour wrote:
can you post your model?
On Tue, Nov 21, 2017 at 3:31 PM, Dominik Szmaj
mailto:dominik.sz...@snello.pl>> wrote:
Hey,
I have a very big perf
can you post your model?
On Tue, Nov 21, 2017 at 3:31 PM, Dominik Szmaj
wrote:
> Hey,
>
> I have a very big performance problem with Django and Oracle db.
>
> This legacy db has lots of primary keys as strings from the time when
> those id's were alphanumerical so it can't be simply converted to
Thank you for sharing.
Yes, the model is not difficult, that's why everybody helps himself up to
now. Maybe this is the best solution and there is not much in common.
The things which are in common (ORM, Admin-Interface) are already provided
by django.
It's just a bit of glue-code to get it w
On Tuesday, April 4, 2017 at 5:18:42 AM UTC-7, guettli wrote:
>
> In the past I was told: Don't store logs in the database.
>
For general purposes, I agree with this. Logging is a python standard, logs
can be verbose, logrolling solutions are well established (and built in),
etc. However, there
Hi Marten,
Am Donnerstag, 6. April 2017 14:10:58 UTC+2 schrieb knbk:
>
> Hi Thomas,
>
> The primary purpose of logging is to catch and examine errors. If
> something went wrong, you want to know *when *and *why*. Logging to a
> database increases the complexity and greatly increases the number o
Am Donnerstag, 6. April 2017 10:42:17 UTC+2 schrieb Christian Ledermann:
>
> On 6 April 2017 at 09:15, guettli >
> wrote:
> > Hello Brick Wall, how are you doing?
>
> Hello Stonemason.
>
> What is your question?
>
>
It was more an idea than a question.
The question could be: What do you th
Hi Thomas,
The primary purpose of logging is to catch and examine errors. If something
went wrong, you want to know *when *and *why*. Logging to a database
increases the complexity and greatly increases the number of things that
can go wrong. The last thing you want to find out when retracing a
On 6 April 2017 at 09:15, guettli wrote:
> Hello Brick Wall, how are you doing?
Hello Stonemason.
What is your question?
I do not have a strong opinion on your approach - i don't even know
the problem you are trying to solve.
or how big your logs are. a couple of KB per day or some GB per hour?
Hello Brick Wall, how are you doing?
Am Dienstag, 4. April 2017 14:18:42 UTC+2 schrieb guettli:
>
> In the past I was told: Don't store logs in the database.
>
> Time (and hardware) has changed.
>
> I think it is time to store logs where I have great tools for analyzing
> logs.
>
> Storing in a m
I didn't quite understood the question, you want to find the division of
two prices for each item, but each item has only one price according to the
model you posted.
can you express what you want to accomplish in python or SQL?
On Sat, Nov 26, 2016 at 10:15 PM, Artem Bernatskyy <
artem.bernats..
Ok, thanks.
On Monday, 13 July 2015 16:14:29 UTC+1, Avraham Serour wrote:
>
> Personally I don't see obvious errors, but it is hard to tell with only
> this small snippet.
>
> If it works what are you worried about? Performance? If you are having
> performance problems you can try caching the qu
Personally I don't see obvious errors, but it is hard to tell with only
this small snippet.
If it works what are you worried about? Performance? If you are having
performance problems you can try caching the query
On Mon, Jul 13, 2015 at 6:08 PM, Joss Ingram wrote:
> Ok, thanks fair enough.
>
>
Ok, thanks fair enough.
my Question then is :
Is the query above bad?
On Mon, Jul 13, 2015 at 4:00 PM, Avraham Serour wrote:
> You told a story but didn't ask a question
>
> On Mon, Jul 13, 2015 at 5:54 PM, Joss Ingram
> wrote:
>
>> I'm not getting much joy with my question, is there too litt
You told a story but didn't ask a question
On Mon, Jul 13, 2015 at 5:54 PM, Joss Ingram wrote:
> I'm not getting much joy with my question, is there too little info?
>
> On Friday, 10 July 2015 15:31:50 UTC+1, Joss Ingram wrote:
>>
>> Hi,
>>
>> In my models I have an event index page type, which
I'm not getting much joy with my question, is there too little info?
On Friday, 10 July 2015 15:31:50 UTC+1, Joss Ingram wrote:
>
> Hi,
>
> In my models I have an event index page type, which can have child event
> pages, each event page can be tagged (using taggit), and I want to produce
> a
On 04/09/14 Benjamin Scherrey said:
> The short answer to your question is no, the Django ORM is not inherently
> slower in that regard and it's very likely something you're doing. The
Given that it's basically
for obj in foo.objects.all():
obj.prop = new_value
obj.save()
I fail to see
On 03/09/14 Tom Lockhart said:
> I haven't had to deal with this myself, but the speed difference smacks of
> transactional issues. If you can run your loop by wrapping all of it or
> pieces of it (say, 100 or 1000 chunks) in a single transaction you'll
> probably see some significant speedup.
Ye
On 04/09/14 Tom Evans said:
> Is the update invariant? By using the ORM like this:
As I said, each update is unique and they cannot be batched.
> Are both Django and the sqlalchemy doing the same sort of update?
Yes. Identical.
Mike
--
You received this message because you are subscribed to
On Thu, Sep 4, 2014 at 12:22 AM, msoulier wrote:
> Hi,
>
> I am looking at Django's performance with respect to modifying large numbers
> of objects, each in a unique way that cannot be batched. If I make a simple
> change to one of my Django models and save(), and then do the same thing in
> sqla
Thanks to the OP for asking this, and to all who answered. Ben, special
stars to you - you just shared some very valuable insight into efficieint
use of the ORM (wasn't obvious to me).
Kind regards,
Lloyd
On Thu, Sep 4, 2014 at 2:21 AM, Benjamin Scherrey
wrote:
> The short answer to your quest
The short answer to your question is no, the Django ORM is not inherently
slower in that regard and it's very likely something you're doing. The
useful answer is probably more complicated. :-) Naive usage of the ORM
without an understanding of how it translates to SQL is likely to result in
some re
On 2014-09-03, at 4:22 PM, msoulier wrote:
> Hi,
>
> I am looking at Django's performance with respect to modifying large numbers
> of objects, each in a unique way that cannot be batched. If I make a simple
> change to one of my Django models and save(), and then do the same thing in
> sqla
>From the lack of other folks jumping in saying "do it this way", I'm going
to guess that this is a hard problem. I am not a database heavyweight.
(IANADbH) I especially don't know about limitations of MySQL.
It seems that you need to calculate a maximum size of Llama objects, but
separately for
I think you misunderstand: I am not actually tracking llama herds. :-)
This is just example code; I haven't actually tested it in the way that you
suggest. The problem isn't with this code in particular, it's with this
concept in general. This is a question I have had again and again in the
past
My point was that annotate might work after the other problems were fixed.
Have you re-tested since? If your annotate still doesn't work then perhaps
someone with more annotate experience than I will comment.
On Wed, Apr 2, 2014 at 12:04 PM, Justin Holmes wrote:
> No no, the annotate doesn't w
No no, the annotate doesn't work - that's the whole reason for my
question. See, the annotate doesn't associate instances with the annotated
attribute, it associated results.
(BTW, good looking out - I have once again fixed the SO question :-))
On Wed, Apr 2, 2014 at 10:17 AM, Bill Freeman wro
1. You now have a foreign key to Herd, but you don't have a model by that
name. It's called LlamaHerd.
2. I was misinterpreting what you wanted (couldn't get past the lack of a
relationship while reading0. Once the relationship is fixed, your original
annotate might work.
On Tue, Apr 1, 2014
You say "use the reverse relation manager in LlamaHerd to build up your
annotation," but that answer the question.
How can I sort LlamaHerd objects by the DOB of their largest llama?
On Tue, Apr 1, 2014 at 6:13 PM, Justin Holmes wrote:
> Yes, absolutely - my bad. I have updated to SO question.
Yes, absolutely - my bad. I have updated to SO question. I meant the
models to look like:
class LlamaHerd(models.Model):
shepherd = ForeignKey(User)
class Llama(models.Model):
size = FloatField()
dob = FloatField
herd = ForeignKey(Herd, related_name="llamas")
On Tue, Apr 1,
Aren't you missing a ForeignKey relationship to tell which LlamaHerd a
Llama belongs to?
Then you would use the reverse relation manager in LlamaHerd to build up
your annotation.
On Tue, Apr 1, 2014 at 5:52 PM, Justin Holmes wrote:
> I have come across this problem in several Django projects, b
As you say the raw sql always is the solution.
But I take a few time to think how that could be possible with the ORM, and
like
akaariai says the prefetch_related get the values for de _default_manager.
But if i defined a temporally manager that makes the only clausure it
works, but i don't know
On May 29, 2013, at 12:44 PM, Àlex Pérez wrote:
> You know the way to simulate the behaviour that i want.?
Raw SQL. At the point you are doing a multi-join query and selecting a subset
of the fields to be returned, you probably should switch to raw SQL anyway.
--
-- Christophe Pettus
x...
Ok thank's!!!
but you thinks thats the normal behaviour? this could be included in future
versions of the orm?
You know the way to simulate the behaviour that i want.?
2013/5/29 akaariai
> There is no way to alter the behavior of prefetch_related. It fetches
> the related objects with the que
There is no way to alter the behavior of prefetch_related. It fetches
the related objects with the query defined by the related manager and
that's it.
- Anssi
On 29 touko, 19:40, Àlex Pérez wrote:
> I want to know if there is a way that the query that is executed to get the
> prefetch related i
10.1.2013 8:59, Ian Kelly kirjoitti:
On Wed, Jan 9, 2013 at 11:40 PM, Jani Tiainen wrote:
If we just force using force_unicode everything works except in older
versions of cx_Oracle (our server had 5.0.4 or something) connection strings
can't be unicode for some reason.
Sure, that's why the c
On Wed, Jan 9, 2013 at 11:40 PM, Jani Tiainen wrote:
> If we just force using force_unicode everything works except in older
> versions of cx_Oracle (our server had 5.0.4 or something) connection strings
> can't be unicode for some reason.
Sure, that's why the check exists in the first place. Pr
9.1.2013 19:21, Ian Kelly kirjoitti:
On Wed, Jan 9, 2013 at 3:55 AM, Jani Tiainen wrote:
Server is running Oracle Database 10g Release 10.2.0.5.0 - 64bit Production.
(EE edition)
and charset info:
NLS_CHARACTERSETWE8ISO8859P1
NLS_NCHAR_CHARACTERSET AL16UTF16
Sorry, I meant your web
On Wed, Jan 9, 2013 at 3:55 AM, Jani Tiainen wrote:
> Server is running Oracle Database 10g Release 10.2.0.5.0 - 64bit Production.
> (EE edition)
>
> and charset info:
> NLS_CHARACTERSETWE8ISO8859P1
> NLS_NCHAR_CHARACTERSET AL16UTF16
Sorry, I meant your web server setup.
--
You receive
9.1.2013 12:28, Ian kirjoitti:
On Wednesday, January 9, 2013 12:38:28 AM UTC-7, Jani Tiainen wrote:
Tested against latest master. Same behaviour.
In Oracle backend base.py is following piece of code:
# Check whether cx_Oracle was compiled with the WITH_UNICODE option.
This will
On Wednesday, January 9, 2013 12:38:28 AM UTC-7, Jani Tiainen wrote:
>
> Tested against latest master. Same behaviour.
>
> In Oracle backend base.py is following piece of code:
>
> # Check whether cx_Oracle was compiled with the WITH_UNICODE option.
> This will
> # also be True in Python 3.0.
Ok, found source of the problem - but I don't know the solution.
I'm using Oracle client 10.2.0.3.0. It seems that unicode doesn't work
there.
I compiled cx_Oracle against 11g instantclient 11.2 and it worked just fine.
So it must be something that Django assumes with Oracle and unicode
capa
Tested against latest master. Same behaviour.
In Oracle backend base.py is following piece of code:
# Check whether cx_Oracle was compiled with the WITH_UNICODE option.
This will
# also be True in Python 3.0.
if int(Database.version.split('.', 1)[0]) >= 5 and not hasattr(Database,
'UNICODE'):
8.1.2013 21:00, akaariai kirjoitti:
I created the following test case into django's test suite modeltests/
basic/tests.py:
def test_unicode(self):
# Note: from __future__ import unicode_literals is in
effect...
a = Article.objects.create(headline='0
\u0442\u0435\u0441\u0442
I created the following test case into django's test suite modeltests/
basic/tests.py:
def test_unicode(self):
# Note: from __future__ import unicode_literals is in
effect...
a = Article.objects.create(headline='0
\u0442\u0435\u0441\u0442 test', pub_date=datetime.n ow())
Works perfectly, thanks :) Tested with a join 4 levels deep too and
it made just one query.
I use select_related elsewhere for more generic optimizations but it
hadn't occurred to me that django would need the hint once in
conjunction with an only() call. Perhaps a patch to ensure that the
appro
Hi John,
Use select_related [1] to tell Django to 'follow' the foreign key. Try
the following:
testmodels =
models.ATestModel.objects.all().select_related('other').only('other__name')
print testmodels[0].other.name
Regards,
Alasdair
[1]:
https://docs.djangoproject.com/en/dev/ref/models/qu
Hi Daniel,
On Apr 22, 5:57 pm, Daniel Gerzo wrote:
> I have a following models:
>
> class Movie(models.Model):
> title = models.CharField(max_length=255)
> year = models.IntegerField(max_length=4)
> rating = models.DecimalField(max_digits=2, decimal_places=1, default=0)
>
> class R
On 19 Mar, 22:49, maxi wrote:
> Hi,
>
> Which is the better way to do this on orm language ?
>
> select filed1, sum(field2 * field3)
> from a_table
> group by field1
>
I believe this is not possible in the current Django ORM.
It would need something like this to work:
MyModel.objects.annotate
Or, using range:
MyModel.objects.filter( Q(a__range=(1,5)) | Q(b__range=(20,70)) )
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects
MyModel.objects.filter( ( Q(a__gt=1) & Q(a__lt=5) ) | ( Q(b__gt=20) &
Q(b__lt=70) ) )
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
On 13 April 2010 01:09, zweb wrote:
> how do i do this kind of condition in django orm filter:
>
> ( 1 < a < 5) or ( 20 < b < 70)
>
> select * from table where (a between 1 and 5) or (b between 20 and 70)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Djang
On Mon, Apr 5, 2010 at 11:33 AM, zweb wrote:
> after some debugging, just found out that
> filter method does not throw DoesNotExist while get does.
get() returns a single object. If a single object does not exist, you
get a DoesNotExist exception. This is documented:
http://docs.djangoproject.c
Well, I was bound to get something wrong :)
> to_be_purged =
> archivedEmail.objects.filter(received__lte=newest_to_delete).values('cacheID',
> flat=True)
the end of the line should be .values_list('cacheID', flat=True) #
not .values(
Cheers
Jirka
--
You received this message becau
Hi,
correct me if I got it wrong, but you essentially need these 4 things:
1) obtain the date for the the newest messages to delete
2) get cacheID of all objects to be deleted
3) delete the files
4) delete these objects from the database
So, you could use something like this:
# get the date
On Tue, Dec 15, 2009 at 03:35:29AM -0800, bruno desthuilliers spake thusly:
> looks like settings.DEBUG=True to me.
Nope. settings.py has DEBUG = False
> wrt/ the other mentioned problem - building whole model instances for
> each row - you can obviously save a lot of work here by using a
> value
On Tue, Dec 15, 2009 at 09:43:02AM +0200, Jani Tiainen spake thusly:
> If you have DEBUG=True setting Django also records _every_ SQL query
> made to database and depending on a case, it might use quite lot of
> memory.
My settings.py contains:
DEBUG = False
--
Tracy Reed
http://tracyreed.org
On 15 déc, 02:44, Tracy Reed wrote:
> I have code which looks basically like this:
>
> now = datetime.today()
> beginning = datetime.fromtimestamp(0)
> end = now - timedelta(days=settings.DAYSTOKEEP)
>
> def purgedb():
> """Delete archivedEmail objects from the beginning of time
2009/12/15 Tracy Reed :
>
> I have code which looks basically like this:
>
> now = datetime.today()
> beginning = datetime.fromtimestamp(0)
> end = now - timedelta(days=settings.DAYSTOKEEP)
>
> def purgedb():
> """Delete archivedEmail objects from the beginning of time until
>
On Mon, 2009-12-14 at 17:44 -0800, Tracy Reed wrote:
> I have code which looks basically like this:
>
> now= datetime.today()
> beginning = datetime.fromtimestamp(0)
> end= now - timedelta(days=settings.DAYSTOKEEP)
>
> def purgedb():
> """Delete archivedEmail objects from the
Try using a) queryset.iterator() to iterate through the results and b)
paginating the results. Otherwise you run the risk of loading all the
results into memory at once,
On Dec 15, 1:44 am, Tracy Reed wrote:
> I have code which looks basically like this:
>
> now = datetime.today()
> beginn
Hi all,
Thanks a lot, for the comments. I'm working with PostgreSQL database
together with with Django and GeoDjango. I intended to use views to query
externally joined tables that keep changing based on the updates. I was also
looking at database consistency by taking into account constraints with
Hello Isoscale,
> I intend to write ORM code that will create views and triggers in the
> database? Which parts of the source code should I alter?
I use django to access views commonly, primarily for reporting I'll
create views taking care of the complex joins from our ERP so
developers can eas
Thanks a lot Karen, transaction was the problem. Resolved by :
connection.cursor().execute('set transaction isolation level read
committed')
Have a nice day :)
On Thu, Oct 8, 2009 at 1:52 PM, Karen Tracey wrote:
> On Thu, Oct 8, 2009 at 5:07 AM, Alexis MINEAUD wrote:
>
>> Ok, my bad, the seq
On Thu, Oct 8, 2009 at 5:07 AM, Alexis MINEAUD wrote:
> Ok, my bad, the sequence works well, i just confused the field name...
> But the problem is still there if the update is done by another actor than
> Django itself.
>
> My standalone script is daemon which poll my DB with a XX.objects.all()
On Oct 8, 6:18 pm, Marek Pietrucha wrote:
> I see that all of you guy's know what your talking about. I was
> thinking way won't you share some knowledge to this
> topic:http://groups.google.com/group/django-users/browse_thread/thread/1517...
>
What does this have to do with this thread? You h
Ok, my bad, the sequence works well, i just confused the field name...
But the problem is still there if the update is done by another actor than
Django itself.
My standalone script is daemon which poll my DB with a XX.objects.all(). If
i updated myself a row from XX, the daemon doesn't see the m
I see that all of you guy's know what your talking about. I was
thinking way won't you share some knowledge to this topic:
http://groups.google.com/group/django-users/browse_thread/thread/1517053b51a1d7c8/
Please read and give some response.
best regards.
On Oct 7, 7:05 pm, Christophe Pettus w
On Wed, Oct 7, 2009 at 7:39 PM, laligatz wrote:
>
> Hi everybody.
>
> I'm stuck on a problem with the Django ORM.
> After a basic query like select * from table where id = 1, the result
> is still the same although i've update the row in the DB.
>
> Example:
>
> >>> Tag.objects.all()
> []
>
> >>>
On Oct 7, 2009, at 2:30 AM, Geobase Isoscale wrote:
> I intend to write ORM code that will create views and triggers in
> the database? Which parts of the source code should I alter?
Django can work just fine with views and triggers, but the Django ORM
layer will not create them for you. V
Geobase Isoscale kirjoitti:
> I have to live with this reality, maybe in future we might develop a
> code to extend Django to support views and triiggers.
I don't get the use case here. What is this need for adding views and
triggers? What purpose they serve for ORM?
For database they're pre
I have to live with this reality, maybe in future we might develop a code
to extend Django to support views and triiggers.
Many Thanks
Isoscale
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
On Wed, Oct 7, 2009 at 5:30 PM, Geobase Isoscale wrote:
> Hi Everyone,
> I intend to write ORM code that will create views and triggers in the
> database? Which parts of the source code should I alter?
This is the third time you've asked the same question in less than a
week. I answered the fir
1 - 100 of 128 matches
Mail list logo