View "functions" that are callables?

2024-05-15 Thread Christophe Pettus
Hi, I'm surprised I don't know this, but: Can a view "function" in a urlconf be a callable that is not actually a function, such as a class with a __call__ method? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: URGENT: DJANGO & COPYRIGHT

2024-02-02 Thread Christophe Pettus
> On Feb 1, 2024, at 07:02, Lightning Bit > wrote: > > Can one copyright an entire Django Project if it contains licensed code from > APIs? Or, does the copyrightable code only apply to exclusive algorithms > developed on the backend? A disclaimer: I am not a lawyer, and this is not legal

Re: Error or stack trace redirection in Django

2020-07-12 Thread Christophe Pettus
roduction website. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.c

Re: Async creation of models on form save

2018-08-18 Thread Christophe Pettus
managers: http://www.celeryproject.org -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubs

Re: django models

2018-08-07 Thread Christophe Pettus
> On Aug 7, 2018, at 10:14, Ramandeep Kaur wrote: > > My question is that how to delete models in django? Do you need to delete a model *class*, or a model *instance*? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Goog

Re: sqlite DB missed DEFAULT parameter from table definition

2018-08-06 Thread Christophe Pettus
gration framework and the RunSQL migration, or outside of Django, or, 2. Specify the value you want inserted when inserting directly using SQL. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: sqlite DB missed DEFAULT parameter from table definition

2018-08-06 Thread Christophe Pettus
ngo does not currently set database-level defaults. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to djang

Re: Django keeps object references in case of exception

2018-08-03 Thread Christophe Pettus
ediately upon the reference count reaching 0; it's run when the object is garbage-collected, which can be some time later. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fr

Re: JSON serializable error

2018-08-03 Thread Christophe Pettus
h does allow serializing datetimes: https://docs.djangoproject.com/en/2.0/topics/serialization/#djangojsonencoder -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fr

Re: Optimizing Prefetch for Postgres IN Limit

2018-07-26 Thread Christophe Pettus
he IN list, the less efficient that will be. In general, large IN clauses aren't a great idea; they're better replaced with a join. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: How to formulate a query over two models?

2018-04-11 Thread Christophe Pettus
SQL, you can do it as a raw SQL query; otherwise, you'll need to transform the data in Python. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: How to formulate a query over two models?

2018-04-11 Thread Christophe Pettus
ng said, you might consider getting rid of the MetaDataValue table, and putting the values in as a JSON field on MetaData. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Re: FOREIGN KEY constraint failed

2018-04-07 Thread Christophe Pettus
ly creating an Order object that has a foreign key, but that foreign key isn't properly set. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop r

tox?

2017-10-08 Thread Christophe Pettus
o require a tool for testing unless it's very widely used. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send

Re: Unicode decoding error

2017-04-12 Thread Christophe Pettus
od that returns a Python 2 string (not unicode) object, UTF-8 encoded. Personally, I would prefer to use the Python 2 'unicode' type everywhere I can in Python 2, so casting everything to six.text_type (and use from __future__ import unicode_literals etc.) would do that. -- -- Chris

Re: Unicode decoding error

2017-04-11 Thread Christophe Pettus
. That means six.text_type(self.a) rather than > str(self.a) (which returns bytes on Python 2). > > On Tuesday, April 11, 2017 at 11:18:02 AM UTC-4, Christophe Pettus wrote: > I've run into the issue described in the code below, where (as far as I can > tell) a natural use of __

Unicode decoding error

2017-04-11 Thread Christophe Pettus
sers/xof/Documents/Dev/environments/peep/lib/python2.7/site-packages/django/utils/six.py", line 842, in klass.__str__ = lambda self: self.__unicode__().encode('utf-8') UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Re: Why was Roberto Rosario silently removed from the Django Software Foundation?

2016-11-12 Thread Christophe Pettus
djbFKsByg%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fr

Sharing apps across sites

2016-09-21 Thread Christophe Pettus
te-c-app/ site-a-manage.py site-a/ url.py site-b-manage.py/ ... etc. -- Independent VCS repositories, with the shared apps as submodules or something like that. Thoughts? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you a

Re: Extracting the username:password from the host

2016-09-12 Thread Christophe Pettus
On Sep 12, 2016, at 12:40 PM, Carl Meyer wrote: > Yes, it should be in `request.META['HTTP_AUTHORIZATION']`; see > https://www.djangosnippets.org/snippets/243/ for an example. ... and now it works. OK, clearly, either me or the server need more coffee. Thank you! -- -- C

Extracting the username:password from the host

2016-09-12 Thread Christophe Pettus
quest object? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Christophe Pettus
On Aug 30, 2015, at 2:37 PM, Christophe Pettus wrote: > On Aug 30, 2015, at 12:43 PM, Dennis Marwood wrote: > >> How do I get the template to treat {{ }} in my entry as a variable? > > The Django template language doesn't iterate over the results of expansion; > o

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Christophe Pettus
ot;appear" in the result due to variable expansion You could do this by building the template up programmatically, and then passing the output of that process to the appropriate render method. You could also (probably better) write a custom template tag that does the right thing. -- -- Chri

Re: "RuntimeError: Error creating new content types."

2015-04-17 Thread Christophe Pettus
applied, but in fact had not been. On Apr 17, 2015, at 1:25 PM, Tim Graham wrote: > The contenttypes name column was removed in Django 1.8. Could you retrieve > the underlying exception before the RuntimeError is raised? > > On Friday, April 17, 2015 at 2:55:07 PM UTC-4, Christophe

Re: "RuntimeError: Error creating new content types."

2015-04-17 Thread Christophe Pettus
ontentType model, but I don't see that ever actually being called. On Apr 17, 2015, at 11:24 AM, Christophe Pettus wrote: > On Django 1.8, I'm encountering this error when attempting to apply > migrations on the production system. What's interesting is that it works > fine

"RuntimeError: Error creating new content types."

2015-04-17 Thread Christophe Pettus
l/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 78, in get_for_model "Error creating new content types. Please make sure contenttypes " RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate

Call for Papers for Djangocon US 2014 *extended*

2014-06-30 Thread Christophe Pettus
Greetings, The Call for Papers for Djangocon US 2014 has been extended through July 15, 2014. (The web site still shows the old date, but will be updated shortly.) Please share what you know with us! http://djangocon.us/ Best, -- -- Christophe Pettus x...@thebuild.com -- You

The DjangoCon US 2014 CfP is open.

2014-06-11 Thread Christophe Pettus
entire Django community. The CfP closes June 28th (soon!), so please get us your wonderful ideas. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: Enumerating objects in foreign key in the admin

2014-05-31 Thread Christophe Pettus
ds > > Of course, a custom widget might give you a better UI, but if you're just > looking to make it work and not drag the rendering of the admin UI page to a > crawl, it works. > > Yours, > Russ Magee %-) > > On Sat, May 31, 2014 at 1:17 PM, Christophe Pettus wrote

Enumerating objects in foreign key in the admin

2014-05-30 Thread Christophe Pettus
, custom widget, is there a way to avoid this? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-user

Re: Django Periodic tasks

2013-08-16 Thread Christophe Pettus
ould do in this situation? Calculate the value on demand, and cache it with an expiration time, most likely. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and s

Re: Do we need to setup Database Settings before Using Admin feature in Django?

2013-08-14 Thread Christophe Pettus
d the Django admin would be without a database to use. The admin works on your Model classes, so it needs a database, and the database tables that correspond to the Model objects, already created. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscri

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
On Jul 6, 2013, at 8:58 PM, Leandro Boscariol wrote: > And also thanks for mentioning xact, I wasn't aware of that! Full disclosure: I wrote it. :) In 1.6, the new atomic() decorator / context manager is the way to go, but xact() works fine for now! -- -- Christophe Pet

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
ter one to fail. If you want proper two-phase commit, you'll (at the moment, at least) have to roll your own. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Ajax

2013-06-29 Thread Christophe Pettus
p at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this

Re: How to have two unicode methods in the models?

2013-06-25 Thread Christophe Pettus
les unicode() and str() calls. In those situations, I just create a new method with an appropriate name. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

DjangoCon. US CFP extended

2013-06-19 Thread Christophe Pettus
te is being updated shortly, but if it still says 6/18, don't worry.) Thanks, -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from i

DjangoCon US CFS closes 6/18

2013-06-04 Thread Christophe Pettus
Hi, all, Just a gentle reminder that the DjangoCon US Call for Submissions ends June 18th. Thanks! http://www.djangocon.us/cfp/ -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users"

Re: ORM Prefetch related and only()

2013-05-29 Thread Christophe Pettus
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

Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
n control. > > On Tuesday, May 28, 2013 4:31:08 PM UTC-4, Christophe Pettus wrote: > > On May 28, 2013, at 1:26 PM, Chris Conover wrote: > > > # no middleware that does any writes > > Are you using the Transaction Middleware? > > -- > -- Christophe Pettus &

Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
On May 28, 2013, at 1:26 PM, Chris Conover wrote: > # no middleware that does any writes Are you using the Transaction Middleware? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
hat the database logs will show you. It's very unlikely that this is a bug in Django or MySQL; those are very well-trod paths in those two applications. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django us

Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
able to do a SELECT and the data > should be available. In the code written, the SELECT is definitely coming > after the INSERT. The code is not complex. I'm setting up a local test to > simulate the load on the production system to see if I can reproduce the > issue. > > On T

Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
In the meantime, you can use this: https://github.com/Xof/xact On May 28, 2013, at 10:29, Chris Conover wrote: > That seems to only be available in the dev version of Django (now 1.6 alpha). > > On Wednesday, May 22, 2013 4:43:29 AM UTC-4, Christian Schmitt wrote: >> >> if you want transa

DjangoCon US 2013 CFP is open

2013-05-22 Thread Christophe Pettus
Hi, all, The Call for Proposals for DjangoCon US 2013 is now open! We encourage everyone, regardless of speaking experience, to submit a proposal. We're particularly interested this year in hands-on experiences and case-studies: http://www.djangocon.us/cfp/ Thanks! -- -- Chris

Re: Understanding Django transactions

2013-05-22 Thread Christophe Pettus
t. You have to call > transaction.commit() at some point to save changes. Just to clarify, `atomic` will commit in this scenario: with atomic: my_model_object.save() You don't have to explicitly call transaction.commit() to issue a commit after the .save(), correct? -- -- Christophe

Re: Django 1.6 Connection Pooler

2013-05-17 Thread Christophe Pettus
feature, but a stand alone pooler definitely has a role still. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an e

Re: How to get ten random records

2013-03-18 Thread Christophe Pettus
query. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this grou

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Christophe Pettus
there are (sometimes) complaints from people moving from MySQL that PostgreSQL doesn't work that way. I weep for humanity. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

Re: A question about template fragment caching

2013-02-16 Thread Christophe Pettus
On Feb 16, 2013, at 9:16 AM, Christophe Pettus wrote: > > On Feb 16, 2013, at 8:50 AM, ozgur yilmaz wrote: > >> I'm using template fragment caching in my project. I'm wondering what >> the view function do when template fragment caching is active? Are >

Re: A question about template fragment caching

2013-02-16 Thread Christophe Pettus
have those expense queries be done on-demand in a callable that is invoked by the template, so they are only called when the template is actually rendered. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django u

Re: Help me choose OS for django server

2012-10-31 Thread Christophe Pettus
a.com/Lists/MPEG%20LA%20News%20List/Attachments/231/n-10-08-26.pdf If you are changing end users, there are potentially fees, but they are quite modest: http://www.mpegla.com/main/programs/AVC/Documents/AVC_TermsSummary.pdf -- -- Christophe Pettus x...@thebuild.com -- You received t

Re: Reverse and kwargs...

2012-10-29 Thread Christophe Pettus
On Oct 29, 2012, at 5:06 PM, Lachlan Musicman wrote: > Your solution made it work, and I'm a doofus. Let he who is without having spent the entire day looking for a punctuation error in code cast the first stone. :) -- -- Christophe Pettus x...@thebuild.com -- You received this

Re: Reverse and kwargs...

2012-10-29 Thread Christophe Pettus
On Oct 29, 2012, at 4:52 PM, Lachlan Musicman wrote: > Could you please expand on your answer for a beginner? student-reports in the reverse call vs student_reports in the url() definition? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed

Re: Reverse and kwargs...

2012-10-29 Thread Christophe Pettus
t;> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > > > -- > ...we look at the present day through a

Re: Append only tables/models

2012-10-24 Thread Christophe Pettus
hat allow data to be updated. -- -- Christophe Pettus x...@thebuild.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 ema

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-20 Thread Christophe Pettus
els (for text fields, you get both the standard one and the varchar_pattern_ops one, which is technically no longer required). -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: PostGIS 2.0.0 problems

2012-08-03 Thread Christophe Pettus
ting to see it > settle down after release with some minor fixes and additional releases. Well, 2.0 has been out for four months so far, so it's not exactly a brand-new release. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed t

Re: Avoiding code repetition in views

2012-06-28 Thread Christophe Pettus
st-building code in a reasonable way. -- -- Christophe Pettus x...@thebuild.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 djang

Re: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Christophe Pettus
sation was a typo, apologies! -- -- Christophe Pettus x...@thebuild.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 emai

Re: PostGIS 2.0.0 problems

2012-04-07 Thread Christophe Pettus
the indexes rather than letting Django do it. -- -- Christophe Pettus x...@thebuild.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,

Re: PostGIS 2.0.0 problems

2012-04-07 Thread Christophe Pettus
On Apr 7, 2012, at 11:41 AM, Oleg Korsak wrote: > So looks PostGIS 2.0.0 is unusable with Django right now? There's no reason you can't apply the SQL manually for the moment. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed

Loading multi-line SQL as part of syncdb

2012-02-29 Thread Christophe Pettus
ght way to apply multi-line SQL during syncdb? Best, -- -- Christophe Pettus x...@thebuild.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 fro

Re: Using STATIC_URL in CSS/JS files?

2012-01-03 Thread Christophe Pettus
ngine doesn't choke on single braces. -- -- Christophe Pettus x...@thebuild.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

Re: Using STATIC_URL in CSS/JS files?

2012-01-02 Thread Christophe Pettus
nt to cache the heck out of it for performance reasons. There are also a wide variety of tools which generate CSS from various input files to allow for various kind of template expansion, and those might be a suitable alternative. -- -- Christophe Pettus x...@thebuild.com -- You recei

Re: TransactionMiddleware recommendation

2011-09-21 Thread Christophe Pettus
ght work for you. However, as soon as you start having interdependent objects, you probably need something more sophisticated. Discussion here: http://thebuild.com/blog/2009/11/07/django-postgresql-and-transaction-management/ -- -- Christophe Pettus x...@thebuild.com -- You recei

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Christophe Pettus
between an IN and a join will cross, however. -- -- Christophe Pettus x...@thebuild.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 thi

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Christophe Pettus
gigantic inclusion sets. -- -- Christophe Pettus x...@thebuild.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 dja

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Christophe Pettus
f prop_dates has more than 10-15 entries, it's going to perform badly (at least on PostgreSQL, and almost certainly on MySQL too). I think this particular situation is definitely a .raw() opportunity. -- -- Christophe Pettus x...@thebuild.com -- You received this message because yo

Re: django transactions.

2011-06-07 Thread Christophe Pettus
gt; So I got this exception but the changes made on the DB during the > method execution still there. Which back-end are you using? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: boolean default

2011-05-15 Thread Christophe Pettus
generate a DEFAULT in the SQL; the default is implemented in the Django ORM. -- -- Christophe Pettus x...@thebuild.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.

Re: Slow query on MySQL

2011-03-23 Thread Christophe Pettus
it looks like the way MySQL executes the IN is to read in and sort all of the Topic records, then probing for the matching ones once they're sorted. Generally, if you can avoid IN, especially in MySQL, it's a good idea. -- -- Christophe Pettus x...@thebuild.com -- You recei

Re: Select x random rows from DB

2011-02-21 Thread Christophe Pettus
If you know this is going to be an important part of the application, it might make sense to have a random primary key, such as a UUID. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Select x random rows from DB

2011-02-21 Thread Christophe Pettus
r what. -- -- Christophe Pettus x...@thebuild.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 django-users+unsubscr...@googl

Re: Select x random rows from DB

2011-02-20 Thread Christophe Pettus
CT * FROM table ORDER BY random() LIMIT X") -- -- Christophe Pettus x...@thebuild.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 thi

Re: Dates BC

2011-01-17 Thread Christophe Pettus
the dates, or you can use a different database (like PostgreSQL) that has more robust date support, it might be easier to represent the dates as stylized strings, or as integers on a uniform calendar like the proleptic Julian calendar, instead of using the built-in date type. -- -- Christop

Re: Database Table Locks/unlocks (for reading, writing or both)

2011-01-12 Thread Christophe Pettus
primitives to do so. You can use direct SQL, bypassing the ORM, to issue those commands if you really need to. But the previous commenter's note is right: Pessimistic locking often kills database performance, and is rarely the best solution. -- -- Christophe Pettus x...@thebuild.com -- Y

Re: Django's documention is horrible

2011-01-10 Thread Christophe Pettus
On Jan 10, 2011, at 1:25 PM, Simon W wrote: > For such a good web framework it's a shame that the documention is not > structured well .. at all. I have no doubt that the project would be more than receptive to doc patches to fix the problem. -- -- Christophe Pettus x...@t

Re: De-coupling settings.py from project

2010-12-30 Thread Christophe Pettus
r deployment. All that being said, it's no big deal to emulate the urls.py include facility in settings.py; just include your app-specific settings. You can also have a 'settings.py' (or whatever) file within the application that only that app imports. -- -- Christophe Pettus

Re: delivering streaming videos

2010-12-25 Thread Christophe Pettus
u can maintain full control over who gets to see what videos, without having to tie up a Python/Django instance just doing I/O copies. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: Massive insertion of records

2010-12-25 Thread Christophe Pettus
command from SQLite's command line interface: http://www.sqlite.org/sqlite.html -- -- Christophe Pettus x...@thebuild.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-us...@g

Re: case insensitive "in" query

2010-12-24 Thread Christophe Pettus
nal index on "lower(field)" might help performance. -- -- Christophe Pettus x...@thebuild.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-us...@googlegroups.com. To unsubsc

Re: Massive insertion of records

2010-12-24 Thread Christophe Pettus
w to do inserts via the Django ORM compared to going straight to the database. Which DB are you using, and what format is the data in before it gets inserted? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Dja

Re: Django RSS feed consolidator?

2010-12-22 Thread Christophe Pettus
Like, say, the one at: http://www.djangoproject.com/community/ You know, something like that? Never mind! On Dec 22, 2010, at 3:04 PM, Christophe Pettus wrote: > Is there a feed consolidator for Django-related RSS feeds? One exists for > the PostgreSQL project, and it's

Django RSS feed consolidator?

2010-12-22 Thread Christophe Pettus
Is there a feed consolidator for Django-related RSS feeds? One exists for the PostgreSQL project, and it's pretty nice to keep track of what PG-related stuff is being written by various bloggers. If not, is there interest in such a thing? -- -- Christophe Pettus x...@thebuild.com --

Re: Django vs Postgres Connection

2010-12-17 Thread Christophe Pettus
could not connect to server: > Permission denied > Is the server running on host "127.0.0.1" and accepting > TCP/IP connections on port 5432? What's your database configuration on the Apache machine? -- -- Christophe Pettus x...@thebuild.com -- You received th

Re: Developing a search engine

2010-12-15 Thread Christophe Pettus
y bit of raw SQL, but you can use it with the new .raw() query sets. http://www.postgresql.org/docs/9.0/interactive/textsearch.html -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: I don't get the big picture (admin, etc.)

2010-12-13 Thread Christophe Pettus
ouch the admin whatsoever ? See #1. It's far easier to build up the public facing part of the site with what users *can* do, than worry about having missed something in the admin that they *can* do. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are sub

Re: How to write good form validation in Django?

2010-12-10 Thread Christophe Pettus
;t ask the user if they want to POST data again? Well, a refresh in this case on the user's part *is* a request to repost the form data again. What's the condition you are trying to avoid in this sitaution? -- -- Christophe Pettus x...@thebuild.com -- You received this message b

Re: Beta page and "under construction"

2010-12-09 Thread Christophe Pettus
pplication for a customer middleware module that redirects to the beta page on the basis of the IP. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: django-extensions - "Error: no module named django_extensions"

2010-12-08 Thread Christophe Pettus
On Dec 8, 2010, at 6:48 PM, Victor Hooi wrote: > Not sure what's going on here? Is the django_extensions module on your PYTHONPATH? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" grou

Distinguish between None and False/0/[] in a template?

2010-12-06 Thread Christophe Pettus
Pardon if this is a FAQ, but is there a built-in way of distinguishing between None and the other typical false values (False/0/[]) in a template? Something along the lines of: {% if var == None %} ... {% endif %} Thanks! -- -- Christophe Pettus x...@thebuild.com -- You received

Re: Create an object before calling the save method

2010-11-27 Thread Christophe Pettus
e=t) c.save() You can add appropriate checks if the title and category already exist, to handle those the way you wan tto. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Caching middleware causes default page caching

2010-11-26 Thread Christophe Pettus
ache/#the-per-site-cache -- -- Christophe Pettus x...@thebuild.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-us...@googlegroups.com. To unsubscribe from this group, se

Re: percentage of models given field value?

2010-11-24 Thread Christophe Pettus
db/managers/#adding-extra-manager-methods -- -- Christophe Pettus x...@thebuild.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-us...@googlegroups.com. To unsubscribe from this group, s

Re: percentage of models given field value?

2010-11-24 Thread Christophe Pettus
t the SQL can't be in the view function, but it's cleaner to have the Model encapsulate all of the related data access for a particular model; that way, if the fields in the model subclass change, there's only one place to look. -- -- Christophe Pettus x...@thebuild.com

'is None' in {% if %}

2010-11-24 Thread Christophe Pettus
is None in the application and setting a separate value in the context, but is there a way of doing this directly on the field itself? Thanks! -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: percentage of models given field value?

2010-11-24 Thread Christophe Pettus
)/(SELECT COUNT(*) FROM app_targettexts)) FROM app_targettexts GROUP BY language This has the advantage that it only hits the database once. If you need the grand total, you can either calculate it in the application, or thorw on: UNION SELECT 'total', CO

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-24 Thread Christophe Pettus
On Nov 24, 2010, at 12:25 AM, bruno desthuilliers wrote: > Err... Would you mean, something like a ChoiceField ?-) Very, very much like a ChoiceField. :) -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Djan

Re: New ManyToManyField Approach

2010-11-23 Thread Christophe Pettus
use hstore or intarray; they adapt very nicely to Pyython types and Django model types. -- -- Christophe Pettus x...@thebuild.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-us...@googlegr

  1   2   >