Re: same form model with separate admins and data

2011-08-12 Thread brian
I've figured a way that I think will work best for me for the model and form but I'm having trouble with writing the view. Here is my pseudo code models.py - class baseModel(models.Model): first_name = models.CharField( max_length=100, verbose_name='first') class

Re: Defunct Processes on Server

2011-08-12 Thread Brian Bouterse
d email to django-users@googlegroups.com. > To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com < django-users%2bunsubscr...@googlegroups.com>. > For more options, visit this group at http://groups.google.com/group/django-users?hl=en. > -- Brian Bouter

Re: same form model with separate admins and data

2011-08-11 Thread brian
for your help Brian -- 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...@googlegroups.com. For mo

Re: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread Brian Bouterse
I know it's not Django specific, but when I need a table for my Django projects, I use jQuery Datatable <http://www.datatables.net/>. It rocks! Brian On Wed, Aug 10, 2011 at 5:26 PM, Adam Zedan <zedan...@gmail.com> wrote: > Or in other words a good datagrid to use with Dj

Re: spam in response to posting to this list

2011-08-10 Thread Brian Bouterse
to this mailing > list are getting that spam and it really does not help at all if we > all just start posting "+1" mails. > > Michal > -- Brian Bouterse ITng Services -- You received this message because you are subscribed to the Google Groups "Django users&quo

Re: same form model with separate admins and data

2011-08-10 Thread brian
I'm using the Model->ModelForm flow. I was starting with the model and working my way up. Once I get the model I was going to switch to the form and then the view. Brian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: same form model with separate admins and data

2011-08-10 Thread brian
is that when I use form1 the data gets put in form1 and myBaseModel. Thank you for your help Brian -- 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

same form model with separate admins and data

2011-08-09 Thread brian
I've created a form with Model->ModelForm flow. Django is running on a sub-domain and I'm putting separate instances of the form on multiple php websites via iframe. How can I use the same form model but have independent forms? For example I want: form1 to be at: example.com/form1

Re: how to create a hidden field

2011-08-02 Thread Brian Neal
On Aug 2, 3:14 pm, webcomm wrote: > ... > Non-interactively, in the automatic admin, what I get is a visible > text input below the title field and above the summary field.  Here's > the relevant model and modelform:http://pastebin.com/azKgdraw > > -Ryan Oh...you are trying to

Re: TimeField with minute-resolution in forms

2011-07-28 Thread Brian
Just in case anyone else has the same problem and finds their way here... The answers were there in the documentation once I rooted around for a while. I just need to override the default form field provided for my time model field and explicitly specify the allowed formats. class

Re: Include Django form in PHP based website

2011-07-27 Thread Brian Bouterse
an iframe. This minimizes the look and feel consistence since most every page is loaded from PHP. Brian On Wed, Jul 27, 2011 at 9:34 AM, brian <brian.down...@yakkadesign.com>wrote: > I'm learning Django and was hoping to get some advice on an > application I want to try. > > I'

Re: Include Django form in PHP based website

2011-07-27 Thread brian
I'm doing this to add features like better submitted data management and writing the data to another program. Brian -- 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@google

Include Django form in PHP based website

2011-07-27 Thread brian
of it. It seems creating the form is really easy but I'm not sure the best way to include that form in the php website. Do you have any suggestions about creating a Django form that will be included in a php website? In the php website, I'd prefer not to use javascript. Brian -- You received

Re: TimeField with minute-resolution in forms

2011-07-25 Thread Brian
t I need to override - if such a thing exists? Brian -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/j4xBfHyqpAUJ. To post to this group, send email to

TimeField with minute-resolution in forms

2011-07-25 Thread Brian
any advice? Thanks in advance, Brian -- 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...@googlegroups

Re: Adding errors to form after successful validation

2011-07-11 Thread Brian McKeever
feel your pain, validating forms can be a PITA... Try reading through this > last bit of the form validation docs: > > https://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-... > > Cheers, > André Terra > > > > > > > > On Mon, Jul 11, 2011 at 6:02

Adding errors to form after successful validation

2011-07-11 Thread Brian McKeever
I have a search form that is used by a view to search for results and then redirect to display them one at a time. If my search doesn't find any objects matching the criteria, I'd like to display a message saying so. It seems natural to add this error to the search form and redisplay it since it

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Brian Bouterse
is a win for everyone (django, python, open source, ...). My personal heuristic on what is off topic on django-users for python specific questions is this: if the question is python only, if it is ultimately going to be used in a django project, then I consider that on topic. Brian On Sun, Jul 10

Re: throttling login attempts to avoid brute force attacks

2011-07-09 Thread Brian Neal
On Jul 8, 11:03 am, Shawn Milochik wrote: > This topic came up on the list a few months back, and I just wanted to > share the solution I've put into place. > > Short version: > > 1. Ensure that my Web server (nginx) passes the user's real IP address > in the request. > > 2.

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Brian Bouterse
as the reference python interpreter. I was talking with the pypy authors at pycon this past spring and they anecdotally that django and pypy are being used in production on some sites. The folks in the pypy community could probably comment more on this than I could. Brian On Fri, Jul 8, 2011 at 11

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Brian Bouterse
to be figured out is how to get pypy reading the nginx and gunicorn C code natively and then switching over and using JIT compilation on the python code from the gunicorn->django entry point. I would love to hear what others think about this type of thinking. Best, Brian On Fri, Jul 8,

Re: anybody using PhoneGap with Django

2011-07-08 Thread Brian Bouterse
eceived 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...@googlegroups.com. > For more options, vi

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-06 Thread Brian Bouterse
I write a lot of automation on RHEL / CentOS systems and would like to see the built process to look at potentially porting it. Let me know how I can follow the development. Brian On Wed, Jul 6, 2011 at 3:29 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk>

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-06 Thread Brian Bouterse
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...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/

ListView.get_context_data Exception

2011-07-01 Thread Brian Bouterse
ce, yet when it is called from within my post function it fails strangely. I know what I'm doing is kind-of strange, but it should work right? Enlighten me... Thanks, Brian -- Brian Bouterse ITng Services -- You received this message because you are subscribed to the Google Groups "Django user

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Brian Bouterse
xing won't always work either. pastebin.com does have the option to retain snippets forever as an alternative to dpaste.com which deleted them eventually. Brian On Fri, Jul 1, 2011 at 5:58 AM, Russell Keith-Magee <russ...@keith-magee.com > wrote: > On Friday, July 1, 2011, Herman Sch

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-22 Thread Brian Bouterse
this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/SZabiWnq_S0J. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit

Re: Easiest way to limit email warnings?

2011-06-19 Thread Brian Bouterse
+1 for django-sentry. I use it on even the smallest sites and it works great there too. Brian On Sun, Jun 19, 2011 at 9:17 AM, graeme <graeme.piete...@gmail.com> wrote: > What is the simplest way of preventing the flood of emails that > results from a site wide error? I do not wa

audit changes to models

2011-06-16 Thread Brian
of the user/editor. Thanks for any advice you can offer, Brian -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/ZjWvsBbrmS0J. To post to this g

Re: auth.LoginTest seems to require sites

2011-06-16 Thread Brian
In case anyone else has the same issue, the problem stopped when I upgraded django from 1.2 to 1.3. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

overriding widget for "group" in User model

2011-06-16 Thread Brian Craft
Is there an easy way to get checkboxes for groups in the User admin, rather than a multiselect? -- 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: Email Accounts

2011-06-10 Thread Brian Bouterse
This conversation is off topic, and should not be facilitated through the Django users mailing list. There are sites setup for these kinds of things<http://www.freelancer.com/> . Brian On Fri, Jun 10, 2011 at 11:09 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedia

auth.LoginTest seems to require sites

2011-06-09 Thread Brian
', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', Is the test broken or is there something that I'm doing that makes the sites app mandatory? Thanks for any help you can give, Brian

Re: Question about using imports within functions/methods

2011-06-02 Thread Brian Bouterse
nfusion.htm>on how import works in python. Brian On Thu, Jun 2, 2011 at 10:39 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hey guys, > > This is more of a python question, than a Django specific one, but it's > been bugging me f

Re: spawning threads within test cases in django test framework

2011-06-01 Thread Brian
Thanks for the replies. I realised that I could reorganise the code so that all the database updating was done in the main thread. Re TransactionTestCases, I knew I'd read something related to that but didn't find it when I went looking yesterday evening; it sounds like that would have worked

spawning threads within test cases in django test framework

2011-05-31 Thread Brian
in that transaction is hidden from the other threads? Can the database connection (and hence transaction) be shared between the threads? Has anyone encountered this problem before? (And, ideally, came up with a really neat solution...) Thanks, Brian -- You received this message because you are subscribed

Re: Dynamic template loader with TemplateResponse

2011-05-29 Thread Brian Morton
(ContentView, self).render_to_response(context, **response_kwargs) On May 23, 3:01 pm, Brian Morton <rokclim...@gmail.com> wrote: > I have some legacy code that I used to dynamically load a template based on > url if it exists and render a 404 if it doesn't exist. > > def content(requ

Re: Looking for Class Base Views intro (not Generic Class Base Views!)

2011-05-27 Thread Brian Bouterse
ews behavior and interfaces just like Django already has, which is silly when you can just subclass the generic 'View' function. 3. So class based views tend to always inherit from some generic django view ... django.views.generic.base.View at the very least. Hope this is helpful, Brian On Thu, May 26, 201

Re: Overridden Admin Template Not Recognized

2011-05-27 Thread Brian Bouterse
You'll need make sure that "django.template.loaders.filesystem.Loader" is enabled in your TEMPLATE LOADERS to use the app in the way you want. Also, you'll need to place your app BEFORE the 'django.contrib.admin' application in the INSTALLED_APPS list. Hope this helps, Brian On T

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Brian Bouterse
We all have our opinions. Either way this conversation is OT from Django. On Tue, May 24, 2011 at 4:07 PM, Masklinn <maskl...@masklinn.net> wrote: > On 2011-05-24, at 21:57 , Brian Bouterse wrote: > > +1 for xpath > > > > I also like using > > xml.dom.minid

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Brian Bouterse
+1 for xpath I also like using xml.dom.minidom<http://docs.python.org/library/xml.dom.minidom.html>since it is so simple and straightforward. If you XML is poorly formed go with beautiful soup<http://www.crummy.com/software/BeautifulSoup/> . Brian 2011/5/24 Тимур Зарипов <q21

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Brian Bouterse
to rebuild it. Don't be like me and break your system by not using virtualenv. Brian On Tue, May 24, 2011 at 9:42 AM, Shawn Milochik <sh...@milochik.com> wrote: > 1. You can compile Python 2.6 (or 2.7) in your home directory and use that > to create your virtualenvs. > > 2. I do

Re: Example uses of Celery

2011-05-23 Thread Brian Bouterse
lso really excellent integration with celery through the django-celery project. Brian On Mon, May 23, 2011 at 9:49 PM, br <robert...@gmail.com> wrote: > I understand a lot of production systems use celery and/or cron to > automate task queues and/or scheduling. I am just getting i

Dynamic template loader with TemplateResponse

2011-05-23 Thread Brian Morton
I have some legacy code that I used to dynamically load a template based on url if it exists and render a 404 if it doesn't exist. def content(request, template_name='index'): try: return direct_to_template(request, '%s.html' % template_name) except TemplateDoesNotExist:

Re: How do you organize your deployment enviroment

2011-05-23 Thread Brian Bouterse
I use fabric and chef together. Usually fabric bootstraps my chef environment, and then chef takes over. I also don't use cron anymore, but instead use celery <http://celeryproject.org/>. Best, Brian On Mon, May 23, 2011 at 7:50 AM, DK <cypre...@gmail.com> wrote: > What

Re: Is there an HTML editor that's Django-aware

2011-05-20 Thread Brian Bouterse
uot;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...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. >

TemplateView and dynamic template_name in urlconf

2011-05-17 Thread Brian Morton
I have a generic view that accepts its template_name attribute from the urlconf dynamic variable: (r'^(?P[^/]+)$', TemplateView.as_view()), But I get an exception: TemplateResponseMixin requires either a definition of 'template_name' or an implementation of 'get_template_names()' I've read the

Re: default group for new users

2011-05-17 Thread Brian Craft
project __init__.py, but that works inconsistently, apparently because django isn't fully initialized when the project __init__.py is loaded. On Tue, May 17, 2011 at 11:07 AM, Brian Craft <bc...@thecraftstudio.com> wrote: > Is there a good way to add new users to a default group when they a

default group for new users

2011-05-17 Thread Brian Craft
Is there a good way to add new users to a default group when they are created (e.g. via django-registration)? I just tried binding the post_save signal for User, and adding the group in the signal handler (if "created" is true). However, I haven't found a good place (file) to put the connect()

Re: performance of model instgance save()

2011-05-16 Thread Brian
> > I'd think you'll find it's significantly more than a factor of 2. For bulk > > inserts, raw SQL is often several orders of magnitude faster. > > You might want to check outhttp://pypi.python.org/pypi/dse/. My tests > using postgres showed a 3Xperformancegain on inserts compared to > using the

Re: New Django Profiling application

2011-05-13 Thread Brian Bouterse
that does very similar functionality to the functionality discussed. Hope that clears up any confusion. Brian On Fri, May 13, 2011 at 10:20 AM, Xavier Ordoquy <xordo...@linovia.com>wrote: > > On May 13, 9:34 pm, Brian Bouterse <bmbou...@gmail.com> wrote: > >> Go for it!

Re: New Django Profiling application

2011-05-13 Thread Brian Bouterse
com/dcramer/django-sentry>. You're idea sounds great and needed, I just want to encourage you to make sure you're adding to the community, not re-inventing existing solutions. Best, Brian On Thu, May 12, 2011 at 11:44 PM, Adrien LEMAIRE < adrien.lema...@aquasys.co.jp> wrote: > Hello de

Re: How to choose a license for an app or a project?

2011-05-13 Thread Brian Bouterse
ome way, and since I never distribute it I never have to share my derivative changes thereby preventing the GPL project from benefitting from my extensions. That is a pretty easy way to sidestep any of these licenses. Brian On Fri, May 13, 2011 at 7:58 AM, Alistair Grant <akgrant0...@gmail.

Re: imagefield upload_to

2011-05-11 Thread Brian Craft
solved this by moving it to the model clean() method, and using imagefield.file.open() and imagefield.file.read() to get the data for computing the other fields. On Wed, May 11, 2011 at 1:28 PM, Brian Craft <bc...@thecraftstudio.com> wrote: > I have a model with an imagefield, and so

imagefield upload_to

2011-05-11 Thread Brian Craft
I have a model with an imagefield, and some fields that are computed from the image. I'm trying to override the "save" method to fill in the other fields. When I test this in the admin, there are two problems: first, the path (mymodel.image.path) doesn't honor the upload_to setting on the field.

Re: performance of model instgance save()

2011-05-11 Thread Brian
Sure - it's just that bit more convenient and readable to use the ORM approach. If I get the chance, I must try substituting direct calls to psycopg and see if that makes it significantly faster again. I'd guess there's maybe another factor of 2 to be had. -- You received this message because

Re: performance of model instgance save()

2011-05-10 Thread Brian
Having hauled myself a few feet up out of the abyss of ignorance, I can answer my own question (which might be of benefit to others getting started with django). To clarify the problem, I have a standalone script that imports the django settings and uses its ORM pleasantness to populate one of

unit testing and file location

2011-05-10 Thread Brian Craft
I would like unit tests that do file manipulations to run with a different storage "location", so they're not manipulating real app files. Is there a good way to do this? Is there a way to override model field initializers, so I can instance a model, passing in the 'storage' parameter for an

performance of model instgance save()

2011-05-09 Thread Brian
any advice you can offer, Brian -- 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...@googlegroups.c

Re: Encrpting urls to hide PKs

2011-05-09 Thread Brian Bouterse
r-side state machine that ensures what a user can and can't do with the application from a given state. This is not exactly what is being discussed here, but it is near it in topic, so I thought I would mention it. Brian On Mon, May 9, 2011 at 8:59 AM, Cal Leeming [Simplicity Media Ltd] <

Re: Best practice for async task in django?

2011-05-06 Thread Brian Bouterse
AMQP is not too heavy weight for me. +1 for Celery and RabbitMQ. Brian 2011/5/6 λq <lamb...@gmail.com> > Thanks guys. > > Is AMQP a bit too heavy weight? > > Besides celery, are there any realworld in-production usage of > Django+ZeroMQ? > > Is django-ztask stable

Re: stop repetition in template

2011-05-04 Thread Brian Bouterse
I like your second solution a lot better than mine. I've never seen {% ifchanged %} used properly before. Brian On Wed, May 4, 2011 at 1:19 PM, Javier Guerra Giraldez <jav...@guerrag.com>wrote: > On Wed, May 4, 2011 at 11:42 AM, pankaj sharma > <new.pankajsha...@g

Re: stop repetition in template

2011-05-04 Thread Brian Bouterse
structure dynamically in the view code without explicitly pre-defining it as a class or model. Hope this helps. Brian On Wed, May 4, 2011 at 12:42 PM, pankaj sharma <new.pankajsha...@gmail.com>wrote: > hello friends, > i have database of colleges. > i want to show all cities >

Re: Multiple SQLITE databases vs one BIG PostgreSQL database

2011-05-04 Thread Brian Bouterse
something to allow all data to be moved back and forth. It sounds like you have a data sync service. Any thoughts on open sourcing that code? Anyone else know of a project that already does this? Thanks, Brian On Wed, May 4, 2011 at 9:02 AM, David Goehrig <d...@nexttolast.com> wrote:

Re: Multiple SQLITE databases vs one BIG PostgreSQL database

2011-05-04 Thread Brian Bouterse
and closed. Best, Brian On Wed, May 4, 2011 at 6:32 AM, VoodooH <radu.hasan2...@gmail.com> wrote: > Hello guys, > > We currently have a desktop software that uses a sqlite embedded > database. We are now gonna develop the online version for our software > and we need your opi

Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Brian Bouterse
I will definitely be using this next time. Nice post. Brian On Tue, May 3, 2011 at 5:50 PM, Thomas Weholt <thomas.weh...@gmail.com>wrote: > Hi, > > Just posted a new blog about more realistic performance of DSE against > a real database. Head over to http://weholt.blo

Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Brian Bouterse
This would have been so useful on my last project. 14.4 Million records took a couple of days with a single thread using the ORM. This would have really sped things up. Brian On Tue, May 3, 2011 at 7:50 AM, Thomas Weholt <thomas.weh...@gmail.com>wrote: > Inserting, updating or dele

form CharField null vs blank

2011-04-28 Thread Brian Craft
A form with a CharField seems to end up with a zero-length string in the cleaned_data if the field is not in the form data. Is there any good way to avoid this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Extremely Frustrated

2011-04-28 Thread Brian Bouterse
net/htmldoc/options.html#'list'> . Brian On Thu, Apr 28, 2011 at 4:50 AM, Tom Evans <tevans...@googlemail.com> wrote: > On Thu, Apr 28, 2011 at 8:47 AM, Kenneth Gonsalves > <law...@thenilgiris.com> wrote: > > On Thu, 2011-04-28 at 00:27 -0700, Derek wrote: > >>

Re: The import staticfiles_urlpatterns is not working in django 1.3

2011-04-21 Thread Brian Neal
On Apr 21, 12:48 pm, Guevara wrote: > Hello! > My project is failing to import the staticfiles_urlpatterns, using > Eclipse Helios: > > urls.py > > import from django.contrib.staticfiles.urls staticfiles_urlpatterns > > In django 1.3 I already have: > > INSTALLED_APPS = (

object with version

2011-04-21 Thread Brian Craft
I need to create objects with version tracking, a bit like wiki content. Anyone done this in django? I could create a model with a content field and a version field. But I'm not sure how to query (for example) all the latest versions of a set of objects. I'm sure there's a raw sql method via

Re: base.html (extended by others) has to be in project (not app) root?

2011-04-15 Thread Brian Neal
On Apr 15, 2:23 pm, Jeff Blaine wrote: > Thank you all.  I will digest the replies when I have the time to properly > focus back on the issue (it's obviously small, since I have a workaround in > place by shoving base.html into the project root). > > It still, regardless of

Re: Using Q objects vs explicit filters

2011-04-13 Thread Brian Bouterse
Could you include the output to highlight the differences? Brian On Wed, Apr 13, 2011 at 9:32 AM, Gianluca Sforna <gia...@gmail.com> wrote: > In writing a complex filter for an application, I've found a different > behavior between a filter like: > Model.objects.exclude(f

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Brian Bouterse
This is an interesting approach I had not thought of before. Thanks! Agreed, CRUD is not the same as REST. Brian On Tue, Apr 12, 2011 at 10:51 AM, sebastien piquemal <seb...@gmail.com>wrote: > Well ... http://django-rest-framework.org allows you to override the > method by a

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Brian Bouterse
a common pattern I end up implementing a lot, and it would be cool if a rest framework let me accomplish this in an easier way. Brian On Tue, Apr 12, 2011 at 6:23 AM, Tom Christie <christie@gmail.com>wrote: > I've been working on this with some folks: > > http://django-rest-frame

Re: Django app for data management and visualization

2011-04-10 Thread Brian Bouterse
I'm a fan of using flot <http://code.google.com/p/flot/> for visualization. I've used the Google Charts and it works well too. Brian On Sun, Apr 10, 2011 at 2:07 AM, ucnt...@gmail.com <ucnt...@gmail.com>wrote: > > > On Apr 8, 12:22 am, Chris Matthews <ch...@bbd.co.

Re: OPTIMISING OVERHEAD IN DJANGO WITH MYSQL DATABASE

2011-03-30 Thread Brian Neal
On Mar 30, 9:36 am, Dipo Elegbede wrote: > Hi all, > > I have a django application that uses mysql database. > > Everything works just fine except that I noticed some queries do spend a lot > of time to load. > > I have about 15,000 checklists the system would have to

Re: Rewriting Java UI for Django?

2011-03-25 Thread Brian Bouterse
Alarm bells usually go off for me when I am required to purchase a license for code I have written. Maybe I'm just an open source kinda guy, but if I'm going to write code, I should be free to run it without paying a license fee. Flex is a life choice ... I won't be making it. Brian On Fri

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 9:55 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Wed, Mar 23, 2011 at 8:49 PM, Brian Neal <bgn...@gmail.com> wrote: > > items = Post.objects(filter=forum__topic__in=forums).order_by('- > > topic__update_date', '-update_date').sele

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 1:47 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Wed, Mar 23, 2011 at 1:35 PM, Brian Neal <bgn...@gmail.com> wrote: > > So you are suggesting I need to shrink the number of topics or > > possibly link the posts directly to the forum? >

Re: Django 1.3 released -- say thanks!

2011-03-23 Thread Brian Neal
On Mar 23, 8:58 am, Shawn Milochik wrote: > Everyone: > >     I just donated $25 to the Django Software Foundation. I would like > to suggest that others who appreciate all the hard work chip in a > couple of bucks if they are able. Especially those who, like me, want > to

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 12:59 pm, Javier Guerra Giraldez wrote: > On Wed, Mar 23, 2011 at 12:56 PM, Javier Guerra Giraldez > > wrote: > > in this case the problem arises because of the big mismatch between > > the forums_forum table (just 15 records) and the

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 11:45 am, Javier Guerra Giraldez wrote: > > >http://dpaste.com/524865/ > > ok, now it's obvious. > > the second query (the one with topic__forum__in=forums, right?) is > scanning the whole topic table (12Krows).  it seems to be guessing > that picking a significant

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 8:49 am, Javier Guerra Giraldez wrote: > are the EXPLAINs from these exact SQL queries?  i don't see why it > cares about the forum_forum table, which isn't mentioned on the > queries. Sorry, my bad. I've been tweaking things in vain. Here are the correct EXPLAINS.

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 22, 11:01 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Tue, Mar 22, 2011 at 10:42 PM, Brian Neal <bgn...@gmail.com> wrote: > > This is what I came up with to reduce the long times I was > > seeing (but it still is slow). This is probably going to g

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 10:15 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Tue, Mar 22, 2011 at 10:06 PM, Brian Neal <bgn...@gmail.com> wrote: > > I see. There are in fact only 15 forums. But why does it take 40 > > seconds? I can get much better results if

Re: Another problem with django static files

2011-03-22 Thread Brian Neal
On Mar 22, 9:58 pm, jim_rain <j...@rainville.net> wrote: > Brian - > > Thanks for the reply - I missed that step. But when I added it the > behavior changed but still no joy. The form has text field in addition > to the date picker - it looks like this: > > class JTestFo

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 9:56 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Tue, Mar 22, 2011 at 9:49 PM, Brian Neal <bgn...@gmail.com> wrote: > > I studied the SQL that Django generated and it seemed fine to me. > > That's why I wonder if it is a MySQL issue since

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 8:17 pm, smallfish xy wrote: > hi, you can try split the in statement, with less with "in". > > forums = [1, 2, 3, 4, 5] > r = [] > for f in forums : >     r.append(Post.objects.filter(topic__forum=f.id) > return r That's what I did to work around it. I'd

Re: Another problem with django static files

2011-03-22 Thread Brian Neal
On Mar 22, 6:49 pm, jim_rain wrote: > I'm running Django 1.2.5 on a linux (Centos 5.5) server and I'm trying > to use a datepicker widget written by Aaron Williamson (http:// > copiesofcopies.org/webl/2010/04/26/a-better-datetime-widget-for- > django/) > > I followed all the

Slow query on MySQL

2011-03-22 Thread Brian Neal
I apologize in advance as this is probably only tangentially related to Django. I have a forums type Django application. In my RSS feed class I had this Django model query: return Post.objects.filter(topic__forum__id=obj.id).order_by(

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Brian Craft
No, it's not. It's a static file. On Mon, Mar 21, 2011 at 10:23 AM, Matt Robenolt <youdontevenk...@gmail.com> wrote: > Is your main view being rendered by Django or something else? If so, you'll > have access to the cookie. > > On Mar 21, 2011, at 1:09 PM, Brian Craf

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Brian Craft
It's in a cookie once you coerce django into sending the cookie to the browser. This is less automatic for ajax apps, because django isn't serving the forms (which is when it usually sends the csrf cookie). On Mon, Mar 21, 2011 at 9:49 AM, Matt Robenolt wrote: > To

Re: how to get csrf cookie in ajax app

2011-03-19 Thread Brian Craft
Yeah, I'm using that technique. It works fine once you have the cookie. My question was about how to get the cookie, which is not described well in the documentation. Manually calling get_token() in the view for the first ajax GET seems to be working. After that I can POST to other views. On

how to get csrf cookie in ajax app

2011-03-18 Thread Brian Craft
In an ajax-based site, where the page is static, and makes ajax calls after loading, how would one get a csrf cookie? There aren't any templates associated with the views (they just return json strings). Setting of the cookie seems to be a side effect of serving forms in django, but the client

mysql OperationalError

2011-03-10 Thread Brian Craft
When a long-running script loses the db connection, I get this exception: _mysql_exceptions.OperationalError Is there any way to trap this in a database-agnostic way? Or must I hard-code it to mysql? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Django app and Amazon AWS (beginner)

2011-03-09 Thread Brian Bouterse
I recommend running your runserver inside screen<http://www.manpagez.com/man/1/screen/>and leaving it detached when you are logged out. Brian On Wed, Mar 9, 2011 at 9:50 PM, Huy Ton That <huyslo...@gmail.com> wrote: > Well, if you are just doing a development test, as it seems

database connection from long lasting script

2011-03-09 Thread Brian Craft
I have a script that sits in a loop, doing occasional queries, something like while 1: wait.for.some.event() object=get.some.django.db.object() do.something.with(object) transaction.commit_unless_managed() The last line is required so the script will see updates to the database from

Re: current recommendations for using email as username

2011-03-08 Thread Brian Craft
On Tue, Mar 8, 2011 at 12:53 PM, william ratcliff wrote: > If you look through the code in the django admin, then the limit is set in > the database schema. I've read elsewhere that it's also in all the auth form validations, so you have to subclass all of them. I

Re: PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread Brian Bouterse
dit some more codes? > > -- > 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...@g

<    1   2   3   4   5   6   7   8   9   10   >