Re: File upload progress bar for Django?

2008-10-21 Thread john
On Oct 20, 2008, at 12:22 PM, M Godshall wrote: > Is anyone familiar with a django or python tutorial that shows how > to implement > some kind of file upload progress bar? Ideally I'd like to use > jquery, but I'm open to anything at this point. Any links or code > examples would be greatly

Re: File upload progress bar for Django?

2008-10-22 Thread john
On Oct 20, 2008, at 12:22 PM, M Godshall wrote: > Is anyone familiar with a django or python tutorial that shows how > to implement > some kind of file upload progress bar? Ideally I'd like to use > jquery, but I'm open to anything at this point. Any links or code > examples would be greatly

Re: Custom upload handlers: Potential multi threading, session, etc issues. Take a look!

2008-10-22 Thread john
't know > anymore Yes, I think you are. :^) The session is saved at the end of the request. That's why your progress report view doesn't see anything until the upload completes. You could explicitly save the session every chun

Re: inlineformset_factory KeyError after updating

2009-01-06 Thread john
eld.label "Id" %} {{ field }} {% endifnotequal %} The omitted ID is causing your KeyError; leave it in the form. John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Question about ornery nginx reverse proxy in front of apache mod_wsgi

2008-09-27 Thread john
On Sep 25, 2008, at 9:23 PM, Prairie Dogg wrote: > I'm trying to set up a new server to host several existing django > sites. The stack is: > > Ubuntu Hardy Heron > Apache 2.2 MPM Worker w/ mod_wsgi (for dynamic content) > Nginx (for static files) > > I'm migrating away from mod_python. The dja

Re: Storage of files in database

2008-10-07 Thread john
On Oct 7, 2008, at 8:29 AM, Mariana Romão wrote: > Hi, > I'm new in the group and in the use of Dajngo too. > I'm developing an application that needs storage files ".py" in > database (and maybe other types of files). I thought Django did this > "automatically" when I define the field in th

Re: Figuring out prefork v. worker

2008-10-17 Thread john
On Oct 16, 2008, at 4:14 PM, Doug Van Horn wrote: > I was just wondering if anyone else had been through this cycle? My > testing showed I didn't have any issues with mod_wsgi/prefork leaking > info across apps, but maybe someone else has? > > I'm pretty much thinking I shouldn't have bothered w

Cannot serve static files

2009-01-22 Thread john
No matter what i do i can't get my css to load. 100% Frustrated with Django. My index page loads when i request http://127.0.0.1:8000/ but it is not styled. Django dev server returns 404 in console for "GET / css/styles.css HTTP/1.1" In my base template i have: In my urls.py I have: urlpatterns

Re: Cannot serve static files

2009-01-22 Thread john
Thanks but no change. On Jan 22, 11:02 am, Dj Gilcrease wrote: > change > > to > > > Dj Gilcrease > OpenRPG Developer > ~~http://www.openrpg.com > > On Thu, Jan 22, 2009 at 8:53 AM, john wrote: > > > No matter what i do i can't get my css to loa

Re: Cannot serve static files

2009-01-22 Thread john
Thanks but no change. On Jan 22, 11:30 am, Puneet Madaan wrote: > beside href="{MEDIA_URL}css/styles.css"> > you need to correct settings.py to > > SETTINGS_FILE_FOLDER = os.path.dirname( os.path.abspath(__file__)) > > > > On Thu, Jan 22, 2009 at 5:26

Re: Cannot serve static files

2009-01-22 Thread john
.py > >      -admin.py > >      -models.py > >      -views.py > >      -\adminmedia > >      -\media > >        -\css > >          -styles.css > >        -\images > >      -\templates > >        -base.html > >        -index.html >

Re: Cannot serve static files

2009-01-22 Thread john
to be built into most MVC systems (at least the ones i looked into before django). On Jan 22, 12:32 pm, john wrote: > ah ok. good catch. My MEDIA_ROOT = C:\dev\proj. But my media directory > is actually in my app directory, one directory down. I fixed > MEDIA_ROOT to equal C:\dev\proj\ap

Django nube

2009-02-26 Thread john
in the settings module before using the database." django.core.exceptions.ImproperlyConfigured: Please fill out DATABASE_NAME in the settings module before using the database. j...@john-laptop:~/Django/mysite$ python manage.py syncdb Traceback (most recent call last): File "manage.py&quo

Re: Django nube

2009-02-26 Thread john
WOW!!! That was painfully obvious. As I said newbe...to python, django, and programming. Hopefully my questions will get more interesting soon! Thanks On Feb 26, 3:29 am, Karen Tracey wrote: > On Thu, Feb 26, 2009 at 2:41 AM, john wrote: > > > I am trying to follow the Django |

Re: Django nube

2009-02-26 Thread john
Or perhaps they will remain trivial for a while. I added the name as such: DATABASE_NAME = '/Django/mysite/mysite_data.db' {I have tried w/ ~, w/o leading /, with /john/Djan..., and w/ john/ Dja...} My project looks like this: j...@john-laptop:~/Django/mysite$ ls -l total 24 -rw-r--

Re: Raw HTTP request processing?

2009-08-25 Thread John
> Isn't it just > request.raw_post_data Thanks and I suspected it was that but hoped there might be a little example somewhere as the docs don't say much only this: HttpRequest.raw_post_data The raw HTTP POST data. This is only useful for advanced processing. Use POST instead. As I am goin

Re: json serialization error on arrays

2009-08-26 Thread John
be using jetty, servlets, jython as I can optimise everything easily for huge data sets. There is a maximum permissible time lag for each request. On 25 Aug, 21:38, Peter Bengtsson wrote: > what's wrong with turning it into a list? If you gzip it it won't be > that big. > >

Re: Raw HTTP request processing?

2009-08-26 Thread John
sizes - I believe its the GC strategy not scaling well from what I have heard). On 25 Aug, 21:41, Peter Bengtsson wrote: > Here's an example:http://www.djangosnippets.org/snippets/1322/ > > On Aug 25, 5:43 pm, John wrote: > > > > Isn't

Re: Searching disparate databases

2009-06-08 Thread John
dumps change modified date. Have something in the file names (a prefix or suffix) so you know which script to run for each. Thats my idea without knowing more about what you are doing.. John On Jun 8, 11:05 am, Amit Sethi wrote: > Hi all , >            I am trying to develop a web ap

Re: Switching backend database on the fly?

2009-06-08 Thread John
One more requirement.. 4. The application must be self contained i.e contain its own django installation (which has the quick start web server) and sqlite db module. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

problem with syncing sqlite3.6.22

2010-07-19 Thread john
ost recent call last): File "manage.py", line 11, in execute_manager(settings) File "/home/john/Django/lib/python2.6/site-packages/django/core/ management/__init__.py", line 438, in execute_manager utility.execute() File "/home/john/Django/lib/python2.6/site-packag

Re: problem with syncing sqlite3.6.22

2010-07-19 Thread john
name or path must be given. The file *at the path* doesn't need to exist, > but the path needs to be specified. > > The quickest way to get started is to change it to something like > "dev.sqlite3" and re-run it. > > Ben > > On Mon, Jul 19, 2010 at 6:53 PM, joh

setting up datebase

2010-07-23 Thread john
Hi all, I am following the django book. I am to the point of setting up my datebase. It instructs me to enter the command: python manage.py sqlall. When I do I get no output, and no errors. It just returns me to the >>>. python manage.py validate returned 0 errors found. I also tried the sy

setting up datebase

2010-07-23 Thread john
Hi all, I am following the django book. I am to the point of setting up my datebase. It instructs me to enter the command: python manage.py sqlall. When I do I get no output, and no errors. It just returns me to the >>>. python manage.py validate returned 0 errors found. I also tried the sy

No fixtures found

2010-07-25 Thread john
h', 'django.contrib.contenttypes', 'django.contrib.sessions', 'mysite.books'] Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.common.Com

No fixtures found

2010-07-25 Thread john
#x27;, 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'mysite.books'] Installed Middleware: ('django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django

Re: No fixtures found

2010-07-25 Thread john
Oh, I guess it just look concerning. I'll keep working on the tutorial and see what happens. Thanks! On Jul 25, 2:51 pm, n3ph wrote: >   Am 25.07.2010 21:36, schrieb Daniel Roseman: > > > On Jul 25, 8:11 pm, john  wrote: > >> I got the message 'No fixtur

Re: No fixtures found

2010-07-25 Thread john
I still don't see why I am getting the error messages: Traceback: File "/home/john/Django/lib/python2.6/site-packages/Django-1.2.1- py2.6.egg/django/core/handlers/base.py" in get_response 80. response = middleware_method(request) File "/home/john/Djang

Custom Admin Form for ManyToMany, missing Green Plus Sign?

2010-02-13 Thread john
Hi, I just had fun creating a new Custom Admin Form to sort a ManyToMany field by ABC order (why isnt it in ABC order by default on the "def __unicode__" item?) It works great, but now the Green Plus Sign to add more items to the list is missing, where did it go? I guess its not enabled by defaul

Re: Custom Admin Form for ManyToMany, missing Green Plus Sign?

2010-02-13 Thread john
Maybe I didnt fully explain the issue, and it seems that Google added a couple of extra lines to the code above. Ive got an app with 2 Model classes. The first one describes a product (the Item model above). The second one (the Stuff model above), along with other data references the Product via a

i18n Reverse URL Unit Test Error

2010-03-23 Thread John
I have encountered a Unit Test error while using a reverse url lookup for i18n. All is running fine in the development environment. Issues only occur during testing. It appears to possibly be an issue with shared contexts between contrib.auth and views.i18n. Template Code Unit Test Out

Re: i18n Reverse URL Unit Test Error

2010-03-24 Thread John
These are the additions to urls.py js_info_dict = { 'packages': ('cui.translations',), } urlpatterns += patterns('', (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), ) Cheers, John On Mar 23, 6:10 pm, R

Error when doing the tutorial

2010-04-05 Thread John
Hello all, I am new to django and am doing the tutorial and when I run the command below I get the following error. Does anyone know how to solve this? E:\temp_dj_site\mysite>python manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings

ForeignKey('self') field displays primary key in list_filter

2007-07-23 Thread John
Hi guys, In a model I have the line: base_lot = models.ForeignKey('self', blank=True, null=True, related_name='base') In the admin, when I set list_filter to 'base_lot', it displays the primary key of the record it is related to instead of what the __str__ model function returns. Is this norma

Re: ForeignKey('self') field displays primary key in list_filter

2007-07-23 Thread John
Nevermind, I deleted and syncdb'd the models and what i expected showed up On Jul 23, 3:28 pm, John <[EMAIL PROTECTED]> wrote: > Hi guys, > > In a model I have the line: > > base_lot = models.ForeignKey('self', blank=True, null=True, > related_na

tsearch2 problems in postgres?

2007-07-26 Thread John
SELECT *, rank(ts_vec, to_tsquery('default', 'lc & 11(')) FROM us WHERE ts_vec @@ to_tsquery('default', 'lc & 11(') LIMIT 9 OFFSET 0 this query gives an error in tsearch2 saying syntax error any idea on how 2 strip the non safe tsearch stuff before feeding it to sql this is from a web search

startproject errors with Ubuntu

2007-08-05 Thread john
On Ubuntu Feisty (7.04) I upgraded python2.5 via synaptic. I download the django 0.96 tarball, extracted into usr/local then installed with "sudo python setup.py install" The django files seem to be correctly installed under python2.5/site-packages and I can do "python" => python 2.5 ">>> impo

Re: startproject errors with Ubuntu

2007-08-05 Thread john
On Aug 5, 6:43 am, "Jason Ribeiro" <[EMAIL PROTECTED]> wrote: > The 'python-django' package in ubuntu's universe "just works" for me > and 0.96 is in the feisty-backports repository. Why not try that? > > Jason > > On 8/5/07, James B

Re: startproject errors with Ubuntu

2007-08-05 Thread john
On Aug 5, 8:24 pm, ocgstyles <[EMAIL PROTECTED]> wrote: > django-admin.py is a python script that should be ran at the command > line: > > $ django-admin startproject myproject > > ..should work fine. > thks - the tutorial shows the .py extension and that was giving the error. So, can we get the

Re: startproject errors with Ubuntu

2007-08-06 Thread john
On Aug 5, 10:46 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 8/5/07, john <[EMAIL PROTECTED]> wrote: > > > thks - the tutorial shows the .py extension and that was giving the > > error. > > The file's name is 'django-admin.py', n

Re: startproject errors with Ubuntu

2007-08-06 Thread john
On Aug 6, 9:48 am, Brett Parker <[EMAIL PROTECTED]> wrote: > On Mon, Aug 06, 2007 at 06:07:16AM -0700, john wrote: > > > On Aug 5, 10:46 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > > On 8/5/07, john <[EMAIL PROTECTED]> wrote: > > >

Re: [Q] Django with modpython in Ubuntu

2007-08-09 Thread John
It would appear to Be a problem with your cookie.py File.In order for me to help you further I will need To see The source of said file John Menerick Sent from my iPhone On Aug 9, 2007, at 9:03 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED] > wrote: > > Dear all, >

error with Admin

2007-08-13 Thread john
I am just working on my first project. I successfully created a couple of models but get the following error when I poin the browser at /admin/ Any ideas ? thks. Running on Ubuntu Feisty w/ .96 backport. TemplateDoesNotExist at /admin/ admin/login.html Request Method: GET Request URL:

Re: error with Admin

2007-08-13 Thread john
On Aug 13, 6:58 pm, Collin Grady <[EMAIL PROTECTED]> wrote: > Do you have "django.contrib.admin" in INSTALLED_APPS? yes > Are the templates actually present in django/contrib/admin/ > templates/ ? there is a directory /usr/lib/python2.5/site-packages/django/contrib/ admin/templatetags/... "te

Re: error with Admin

2007-08-13 Thread john
On Aug 13, 8:28 pm, Empty <[EMAIL PROTECTED]> wrote: > On 8/13/07, john <[EMAIL PROTECTED]> wrote: > > > > Are the templates actually present in django/contrib/admin/ > > > templates/ ? > > > there is a directory /usr/lib/python2.5/site-pa

Re: error with Admin

2007-08-13 Thread john
On Aug 13, 11:30 pm, Collin Grady <[EMAIL PROTECTED]> wrote: > Your problem is completely unrelated to INSTALLED_APPS, if your django/ > contrib/admin/templates dir is missing. Okay, thks. It appears the Feisty django 0.96 backport is broken. Using synaptic, I removed django, then had to remove

0.96 tarball is corrupt

2007-08-14 Thread john
I've downloaded the tarball several times - each time the archiver shows it as corrupt (other tarballs work fine). Using Ubuntu Feisty. (and the Feisty backport package is broken as well). --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: 0.96 tarball is corrupt

2007-08-14 Thread john
On Aug 14, 1:29 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > I've downloaded the tarball several times - each time the archiver > > shows it as corrupt (other tarballs work fine). Using Ubuntu Feisty. > > (and the Feisty backport package is broken as well). > > Given the multiple responses that t

Can Django be run on 1and1 ?

2007-08-24 Thread john
Can Django be run on a mainstream web hosting company like 1and1.com or does it require a hosting company that specially offers django ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Can Django be run on 1and1 ?

2007-08-25 Thread john
On Aug 25, 7:07 am, Amirouche <[EMAIL PROTECTED]> wrote: > As a general advice don't run anything on 1and1.com ; ) > Unless you want to state a specific good reason, don't make comments like this - we have been using 1and1 for email and static type web hosting for a long time with excellent relia

Re: deleting a foreign key object deletes all related items

2007-09-01 Thread john
> advisor.delete() I expect should just delete the advisor object and > change p2.advisor and p4.advisor to None but advisor.delete() deletes > p2 and p4. This is the expected behavior, and it's behavior that's required to maintain referential integrity in the database. The docs mention it at htt

Model.py not creating MYSQL tables.

2007-09-04 Thread John
I've created a forms application. After running syncdb without any errors I thought database connection with MYSQL was working. Django tables have been created. After I entered http://localhost:8000/contacts I get the following error. ProgrammingError at /contacts/ (1146, "Table 'iansfree.conta

Re: Model.py not creating MYSQL tables.

2007-09-04 Thread John
Thanks. That works. Now I'm only getting partial form (NAME AND PHONE INBOX BOX IS DISPLAYED) with a bunch of html code. The html code isn't being rendered properly. Any ideas Contacts Name: Phone: (NAME AND PHONE BOX IS HERE) On Sep 4, 3:51 pm, Jo

Re: Model.py not creating MYSQL tables.

2007-09-04 Thread John
ONE BOX IS HERE) On Sep 4, 3:58 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 9/4/07, John <[EMAIL PROTECTED]> wrote: > > > > > I've created a forms application. After running syncdb without any > > errors I thought database connection with

Re: Model.py not creating MYSQL tables.

2007-09-10 Thread John
The template, view, and form are in dpaste 18690 [Template] 19181 [View] 19183 [Form] I'm using the django contact form On Sep 4, 6:25 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 9/4/07, John <[EMAIL PROTECTED]> wrote: > > > > > Thanks. T

Re: Sending SMS messages

2008-01-22 Thread John
Let me try and answer your questions. Do you need to receive SMS? If you need to receive SMS, you will need to host your own GSM device or modem so that people can send you SMS. If not, you can just use internet SMS gateways like clickatell to do the work, and post to them by HTTP, XML or email.

Re: Sending SMS messages

2008-01-26 Thread John
can you share some other service names, not necessarily cheaper but with a decent api like clickatell has? >>> clickatell is the best for price and reliability Regards, SMS Gateway Expert http://www.visualtron.com --~--~-~--~~~---~--~~ You received this message

Basic ModelForm operation question

2008-04-19 Thread John
If you have code like this using a form that subclasses ModelForm: if request.method == 'POST': form = MyModelForm(request.POST, instance=some_instance) form.is_valid(): form.save() Does MyModelForm first fill it's fields with data from some_instance, and then override with the da

CPOSC 2008 is looking for Django presentations

2008-05-09 Thread John
f you or someone you know would like to speak at the conference, please see the details below. Don't be shy! :) Thanks, John *** Call for Participation *** CPOSC, the Central PA Open Source Conference, is a one-day, multi- track, low-cost conference about all things open source: software, p

accessing dictionary elements in opening tag of django template for loop

2008-05-14 Thread John
Hello Django Users, I'm having trouble accessing dictionary elements within a nested for loop. here are some code snippets: # here is the python code that sets up the page class DocumentPage(webapp.RequestHandler): def get(self): # get a list of documents from google app engine datastore

Re: accessing dictionary elements in opening tag of django template for loop

2008-05-14 Thread John
Thanks for the response, Norman! Unfortunately, the Google App Engine version of Django doesn't support the 'with' tag (which would otherwise solve my problem). Also, I don't think I can pass in a context var that already has the list I want, because I need a list *per* document. Any suggestions

Re: accessing dictionary elements in opening tag of django template for loop

2008-05-16 Thread John
Thanks, John. Your second suggestion (that I find a way to modify the Document class) put me on the right track. I eventually found this article: http://blog.arbingersys.com/2008/04/google-app-engine-better-many-to-many.html which worked for my problem. On May 14, 7:17 pm, "John L

Re: unit testing and comparing dictionaries

2008-06-17 Thread John
Dictionaries compare equal if they contain the same data, regardless of key order. There is no need to convert to sorted sequences unless you need to compare the serialized output (such as in doctests). I would guess that one of the models has additional fields added to its __dict__, perhaps thro

Re: HTML Escaping JSON data?

2008-06-17 Thread John
If the part of the page being changed is complex, the easiest way to do this is to call render_to_response as usual, but with the template containing only a instead of a full HTML page. Handle any escaping needed in the template. If you only want to update the text without adding any markup, use

create/drop individual table

2007-04-04 Thread John
Hi, new to django, getting familiar w/ it. So far, love what I've seen. One question: how do I create/drop an individual table, preferably not from the manage.py shell? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Re: Can I prepopulate a SlugField with a ForeignKey?

2007-05-21 Thread john
add another function: def get_fields(self): return self.color, self.size, self.price --~--~-~--~~~---~--~~ 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@googl

user object in templates

2007-05-23 Thread John
it seems like I have no user object in my templates, which is weird, as it comes w/ my request object, and I can access it in my views. In other words, request.user.is_authenticated evaluates to True in my views, but to False in my templates. Before you ask, I do have 'django.core.context_process

Contact Form not Rendering Properly

2007-09-11 Thread John
I'm trying to render the contact form in Django. When i enter http://127.0.0.1:8000/contacts/ I'm only getting a partial form (NAME AND PHONE INBOX BOX IS DISPLAYED) with a bunch of html code. The html code isn't being rendered properly.The submit button isn't being displayed. The template, vi

testing questions

2007-09-16 Thread john
coming from Rails so any help appreciated 1) I realize you can use doctests or unit tests - but is one recommended over the other ? 2) Is it recommended to have unit tests within each class in the models.py file or in a separate testing file ? 3) Fixtures using json (I assume json is the recomm

python autolink that doesnt mangle html

2007-09-18 Thread John
Hello guys I m looking for a library or a scrip that autolinks html + non html content such as i love... Spin the bottle Redneck hoe http://den.com";>A http://www.google.com loves ICP songs and the result should be i love... Spin the bottle Redneck hoe http://den.com";>A http://www.google.com

Re: Plz, I am just new to Python...

2007-10-04 Thread John
the details for doing it on MS Windows. GNU/Linux is a good environment for development of all sorts. I recommend upgrading to Ubuntu. ---John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: Hybrid-django server leaving connections open...

2007-11-13 Thread John
On Nov 13, 5:04 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 11/13/07, John Penix <[EMAIL PROTECTED]> wrote: > > > We've stuck a bit of ORM-using code from our "pure" django server into > > another server that was only using djan

Problem with date based list_filter in django admin

2007-11-19 Thread John
I'm having a problem with the query string link generated in the filter sidebar of the django admin. The problem only happens when there are multiple query parameters like month and year. Here is a snippet from the html source By Date Made Any date Today Past 7 days

Re: Problem with date based list_filter in django admin

2007-11-19 Thread John
Yep, I reverted to revision 6669 (one before the autoescape update) and the problem went away. When I re-updated to the current revision the problem appeared again. Maybe I'll file a bug report On Nov 19, 3:02 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > Does this have something to do with the au

Re: Problem with date based list_filter in django admin

2007-11-19 Thread John
This is the exact problem i'm having http://code.djangoproject.com/ticket/5983 On Nov 19, 3:40 pm, John <[EMAIL PROTECTED]> wrote: > Yep, I reverted to revision 6669 (one before the autoescape update) > and the problem went away. When I re-updated to the current revision >

I cant but woefully look at Ruby_oN_rails guys adding ranking with just

2006-10-27 Thread John
ranking with just one line @act_as_votable and they are set.. no more bugs to fix, Do you guys have any ideas on how to do this, somehting similar to @checkaccess in atuh also seems reasonable.. thanks a lot for your time and patience keep rockin in the web/python world John

email not going to bulkfolder

2006-12-03 Thread John
hi guys i have added a few viral features such as email friends, refer, share item etc... but the problem is the email gets delivered to bulk folder by gym... please tell me how to ensure that emails dont get delivered to bulk folder thanks John

edit_inline behavior

2006-08-13 Thread John
lied admin interface, so I'm guessing it's something I'm doing wrong. Any help would be awesome! Apologies if this is a common issue, but a search through the mailing list doesn't indicate anyone has had this problem. -- John --~--~-~--~~~---~--~-

Re: Admin user privilege elevation (how to prevent it)

2012-05-12 Thread John
;t trust admin content if you're a superuser". John On 12/05/12 19:45, Nikolas Stevenson-Molnar wrote: > The issue here is that Josh wants to allow certain users (admins) to > create content with tags, but ensure that said users can't > use JavaScript to gain superuser status

Re: Render time

2012-06-29 Thread John
Look at Boomerang: http://lognormal.github.com/boomerang/doc/ John On 25/06/12 12:34, Larry Martell wrote: > This is not strictly a django question, but I'm hoping someone here > has solved this and can help me. I have a client that has a django app > that collects a bunch

Custom Validation on Inline Generic Foreign Key

2011-08-23 Thread John
Hi there, I am writing an app with Django where I have a model with a generic foreign key. I am looking to do some validation on this model based on the content_type of the generic foreign key. When I am modifying this model on its admin page, I am able to easily determine the content_type because

query concerning three tables

2011-08-24 Thread john
i had three tables, trademarks, publication, and entry trademarks has a foreign key to publication, and publication has a foreign key to entry, and entry has a field called published_date, which i am intrested in.. how should i go about such using filters or similar.. when i am writing something li

Re: saving several models with one save() call

2011-08-24 Thread john
the save method that we call on objects can be overridden.. On Aug 24, 3:28 am, ernando wrote: > Hi all, > > maybe it's newbie question but I wasn't able to find clear answer/ > solution on it. > > For example, we have the following models: > > class A(models.Model): >     id = models.AutoField(

Re: query concerning three tables

2011-08-25 Thread john
On Aug 24, 6:29 pm, Tom Evans wrote: > On Wed, Aug 24, 2011 at 2:12 PM, john wrote: > > i had three tables, > > trademarks, publication, and entry > > trademarks has a foreign key to publication, and publication has a > > foreign key to entry, and entry has a

Re: search with a optional value

2011-08-25 Thread john
s = results.filter(optional_field=optional_value) >     if other_optional_value: >         results = > results.filter(other_optional_field=other_optional_value) >     return results > > On Aug 16, 8:20 am, john wrote: > > > hi, > > i have a form with few fields as optio

Re: query concerning three tables

2011-08-25 Thread john
this gives me 0 as tobjs.count() which shouldn be the case On Aug 25, 12:04 pm, john wrote: > On Aug 24, 6:29 pm, Tom Evans wrote: > > > > > On Wed, Aug 24, 2011 at 2:12 PM, john wrote: > > > i had three tables, > > > trademarks, publication, and entry &

Re: Custom Validation on Inline Generic Foreign Key

2011-08-26 Thread John
Any ideas? In the inline model's validation I could hardcode checks for data that I expect will only be in one of the models, but that does not seem like the best option. I am still hoping for a simpler alternative to this. Thanks. -- You received this message because you are subscribed to the

Re: search with a optional value

2011-08-28 Thread john
thanks On Aug 25, 1:13 pm, Jani Tiainen wrote: > On 08/16/2011 03:20 PM, john wrote: > > > hi, > > i have a form with few fields as optional,i.e can be left blank, > > i want to search my db for values i receive from this form, how should > > i go on about writing

Re: Custom Validation on Inline Generic Foreign Key

2011-08-31 Thread John
I went ahead and hardcoded checks for fields that as of today I know will only be in one of the models. I would still love to hear any cleaner solutions if anyone has them. On Aug 26, 10:12 am, John wrote: > Any ideas? > > In the inline model's validation I could hardcode checks

problem with syncdb and MyQSL

2011-09-02 Thread John
I am a total noob so forgive my ignorance, but I have been going through the Django tutorial - https://docs.djangoproject.com/en/1.3/intro/tutorial01/ I am at the point in the tutorial where I run the following command: C:\Python27>python c:\python27\mysite2\manage.py syncdb Creating tables ...

Re: problem with syncdb and MyQSL

2011-09-02 Thread John
in: # 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', ) # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error.

ORM only/defer calls do not work on cross-table relations

2011-09-27 Thread John
Hey, I'm trying to improve the performance of a Django app, and noticed that you can't seem to properly defer fields when making lookups with joins. To demonstrate, I set up a test project with the following models: class ATestModel(models.Model): other = models.ForeignKey('OtherModel') cla

Re: ORM only/defer calls do not work on cross-table relations

2011-09-27 Thread John
t the appropriate select_related call is made in conjunction with an only() would make sense? On Sep 27, 8:28 pm, Alasdair Nicol wrote: > Hi John, > > Use select_related [1] to tell Django to 'follow' the foreign key. Try > the following: > > testmodels = > models.ATe

Re: Define Meta attributes at runtime

2011-09-30 Thread John
I don't believe you'd be able to do this without altering the code for the framework itself; the Django model metaclass hides the Meta attribute (among other things) for non-abstract-base classes. On Sep 30, 6:45 am, Isaac wrote: > Hi folks, > > I'm wondering if it's possible to set / redefine Me

Re: set_test_cookie() on every page?

2011-09-30 Thread John
While this is not directly your question, if you want to do something on literally every view, the easiest way to do it would most likely be to add a custom middleware with a process_request or process_response method. More to the point, you should not call set_test_cookie on every view - in the e

Re: Get latest item by many items in a queryset

2011-09-30 Thread John
I believe that there is no real way for you to avoid having to perform a query for each backend instance. Even in raw SQL, I don't think there is a way to do what you want - in postgres, for example, you could not both order by the timestamp and get distinct values based on backend. However, ther

Re: Get latest item by many items in a queryset

2011-09-30 Thread John
That would still return a single value - the status update with the latest timestamp with one of those backends. On Sep 30, 9:47 am, Dmitry Kuznetsov wrote: > Something like this? > > backends = [backend1,backend2,backend3] > latest_status = Status.objects.filter(backend__in=backends).latest() >

Tough problem with m2m field

2011-10-18 Thread John
I have been stymied by this one for a day or two now. I have a situation where I have a 'reference' copy of an application which gets deployed as a new django site with it's own database, url's etc. I am trying to automate this deployment as follows: Present a list of existing sites (there are ot

passing data between views / functions

2011-10-20 Thread John
Hello all, I'm building an interactive plotting routine. I have a question on how to manage data objects. I have a View (CBV inherited from DetailView and FormView) that uses information in the URL to parse out a few variables. From those variables I make a file system call to create a dictionary

Using DISTINCT on related model fields

2012-01-10 Thread John
I'm trying to express this query using the Django ORM: SELECT DISTINCT test_b.name FROM test_a LEFT JOIN test_b ON test_a.b_id = test_b.id using Django (with models 'A' and 'B') all I seem to be able to get is SELECT DISTINCT test_a.name, test_a.id FROM a INNER JOIN test_b ON test_a.b_id = test_

  1   2   3   4   5   6   7   8   9   10   >