best way to design poll and choice form for multiple choice entries

2008-11-24 Thread Kevin
Starting from the tutorial, I figured a good first exercise would be to create a front-facing form for creating a poll question and choices. I've successfully done it, but I'd like the implementation of it to be closer to the functionality of the admin interface for adding and removing choices. I

front facing poll form issues

2008-12-26 Thread Kevin
I'd like to create a front facing poll creation form that can automatically handle deletion, reordering of choices. I believe formsets are the easiest way to accomplish this. I start with 3 choices and want to allow the user to add more. Check the following code: def create(request): n

Re: front facing poll form issues

2008-12-27 Thread Kevin
No one has offered any help. That's fine, so let me ask my question differently. Can anyone point me to an example of form processing for formsets? Let's say can_delete=True, how do I process that in my code? I have scoured google and can find no examples, so any examples/links would be apprecia

ensuring a string does not get escaped in views.py

2008-10-17 Thread Kevin
All, I am new to Python and Django. I'm quickly catching on but have finally run in to my first issue. I'm building a simple app that will work with Google's Picasa. The idea is to copy an album from one account to another, something that Picasa won't let you do in its interface. Here's the thi

I need to get psycopg2 installed on Mac OS X 10.5

2009-07-14 Thread Kevin
I need to get psycopg2 installed on Mac OS X 10.5 I have read every install guide I could find and I still do not have it working. I have developer tools installed. I am running MacPython 2.6.2 and PostgreSQL 8.4 downloaded from http://www.enterprisedb.com/products/pgdownload.do On my productio

Re: I need to get psycopg2 installed on Mac OS X 10.5

2009-07-14 Thread Kevin
> > Regards, > >   Juan Pablo > > 2009/7/14 Kevin : > > > > > > > I need to get psycopg2 installed on Mac OS X 10.5 > > > I have read every install guide I could find and I still do not have > > it working. I have developer tools installed. I am runnin

Re: I need to get psycopg2 installed on Mac OS X 10.5

2009-07-27 Thread Kevin
I have gotten psycopg2 to compile though in a roundabout way. I have tried to compile Python from source and got other errors. Although I already had Xcode installed, I decided that it couldn't hurt to reinstall it and see what happens. After doing so, I was able to compile Python without any p

TypeError: execute() takes at most 3 arguments (4 given)

2009-08-22 Thread kevin
cursor.execute("SELECT a,b,c FROM Table_Name WHERE a = %s AND b = %s ", [string1],[string2]) gives me the following error: TypeError: execute() takes at most 3 arguments (4 given) Where did i go wrong? --~--~-~--~~~---~--~~ You received this message because you

Can't build Django documentation

2010-08-13 Thread Kevin
I tried to build the Django docs and got an error. $ cd django/docs/ $ make html sphinx-build -b djangohtml -d _build/doctrees . _build/html Running Sphinx v1.0.1 loading pickled environment... not yet created building [djangohtml]: targets for 427 source files that are out of date updating envi

Re: Can't build Django documentation

2010-08-18 Thread Kevin
Thanks for that info. I downgraded to Sphinx 0.6.6 and all is well. On Aug 14, 11:14 am, Ramiro Morales wrote: > On Sat, Aug 14, 2010 at 9:07 AM, DrBloodmoney wrote: > > > The docs [0] mention an incompatibility with the currently released > > Sphinx. I can't build right now either, and I'm too

Ability to use PSP templates with Django?

2010-08-21 Thread Kevin
I come from the world of mod_python and really enjoyed the PSP template system, where I can embed Python code directly in my template for dynamically generating menus and such. What is the recommended method of calling a PSP template from inside Django and rendering it? Here is a sniplet of code

Trouble comparing variables in a view

2010-08-21 Thread Kevin
I have attempted to troubleshoot this myself with no luck and am very confused why a simple IF statement is not working. I have used if statements in python before and never had such a problem. I am rather glad to see that PRINT outputs to the console, this helps a bit for troubleshooting. Varia

Re: newbie question: generating javascript, avoiding trailing comma

2007-07-19 Thread Kevin
There's a forloop.last variable that you could test. Eg: var crimes = [ {% for crime in crime_list %} [ {{crime.longitude}}, {{ crime.latitude }},'{{ crime.address }}','{{ crime.type }}','{{ crime.date }}'] {% if not forloop.last %},{% endif %} {% endfor %} ]; On Jul 19, 12:35 pm, cjl <[EMA

Add Support for Hex numbers is Admin

2007-09-19 Thread Kevin
to an integer before it hits the database? Thanks, Kevin --~--~-~--~~~---~--~~ 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 unsubs

Re: Add Support for Hex numbers is Admin

2007-09-19 Thread Kevin
This is great thanks! You were one step ahead of me on the display. I'm still reading up on customizing the admin interface, but hopefully something in there will help me adding any javascript if it is needed. Thanks! On Sep 19, 3:25 pm, jake elliott <[EMAIL PROTECTED]> wrote:

Re: Chaining Filters for many-to-many

2007-10-29 Thread Kevin
_size=2048) ) On Oct 29, 5:05 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > Hi, > > On 29.10.2007, at 21:58, Kevin wrote: > > > > > > > I'm trying to figure out how to chain filters for a many-to-many > > relation ship that is evaluating to an empty

Chaining Filters for many-to-many

2007-10-29 Thread Kevin
riteria. Is there a limitation that I'm missing here? Is there an alternative method to accomplish the intent here? Thanks for any help, Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Chaining Filters for many-to-many

2007-10-29 Thread Kevin
e the sets to workaround a bug...oh well...Not complaining too much, I've loved django since I found it. On Oct 29, 5:17 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > On 29.10.2007, at 22:08, Kevin wrote: > > > I've tried some of the Q stuff, and that is probabbl

Re: Chaining Filters for many-to-many

2007-10-29 Thread Kevin
Ah, glad to know that it is a known issue at least and not a new problem. Thanks for the info. On Oct 29, 9:07 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-10-29 at 20:58 +0000, Kevin wrote: > > I'm trying to figure out how to chain filters for a many-

bulk modify in the admin?

2007-11-14 Thread Kevin
oo bad for each particular use case, but just thought it would be pretty neat if I there existed a way to extend/hack the admin interface to do something similar in a more generic fashion. Thanks! Kevin --~--~-~--~~~---~--~~ You received this message because you are su

Re: Manager overriding error

2006-05-09 Thread Kevin
I ran into this problem as well. The issue is that super() expects the child class not the parent class (the documentation is wrong), so try this: super(DahlBookManager, self).get_query_set().. instead of super(Manager, self).get_query_set() In addition, it wouldn't let me create the Manage

Re: Search Engine for Python and Django

2006-07-25 Thread Kevin
On the recommendation that ljworld uses swish-e [1], I incorporated that into my django powered site. The Python interface I use is [2]. Here's the code my search view uses: handle = SwishE.new(SEARCH_INDEX_FILE) results = handle.query(terms) ids = [int(x.getproperty('swishdocpath')) for x in

Re: Search Engine for Python and Django

2006-07-27 Thread Kevin
I run django (and Swish-E) under linux so I can't provide any advise on how to compile it for windows. I do run swish-e with the -S prog option and I wrote a python script that reads all of the models from the database and writes out xml (actually html) that corresponds with the values that I'm i

Re: Using Swish-e with django...

2006-07-31 Thread Kevin
My use of swish-e is clearly different that yours. The indexer part of swish-e is run only periodically (say, nightly) with a `swish-e -S prog -i ./generate_index.py` this creates an index file that the SwishE python api queries --~--~-~--~~~---~--~~ You rec

Manipulator.save() not hitting the DB

2005-11-03 Thread Kevin
I'm trying to use the manipulator framework to generate a multi-part form. It's for an online shopping engine where the customer goes through a few steps entering their shipping and credit card info, etc. Anyways, I created some model classes, eg ContactInfo (phone #, email, etc), Address and Cr

Re: Manipulator.save() not hitting the DB

2005-11-03 Thread Kevin
The base class, Manipulator, just throws a NotImplementedException for it's save() method. Is there a more concrete example I can view to see how to override storing to the database. PS. I'm converting an existing PHP site to django, it's so nice having all these validation/admin stuff just "ta

Re: Using API to bulk populate data

2005-11-07 Thread Kevin
I'm working on a similar script to convert a legacy database. Just a hint from a tough lesson learned, you work the opposite order that OO may teach you and you save() first, then aggregate. So example: class PhoneNumber(meta.Model): number = meta.CharField() class Contact(meta.Model):

FormField Length

2005-11-07 Thread Kevin
In my code, I have: zip_code = meta.CharField(maxlength=9) But when it's rendered as a form, it's always given a SIZE="30". Now I saw that sub-classes like USStateField override the length parameter in the TextField.__init__ method, but I really don't want to go creating all kinds of sub-classe

Re: Dictionary keys in templates

2005-11-09 Thread Kevin
Is there a reason you can't do this: {% for items in dictionary.items %} ... be able to use {{ items.0 }} and "{{ items.1 }}"... {% endfor %} this is equivalent to the python: for key, value in dictionary.items() but since for loops in the template language can only create one variable, you nee

Form Value Array

2005-11-21 Thread Kevin
I'm converting a PHP application over to django and one thing I took for granted was PHPs conversion of inputs with the name "input[]" into an array automatically. Since django nor python seem to support that conversion, what do people suggest for receiving 1 to N inputs on a request.POST? In my

Re: Form Value Array

2005-11-22 Thread Kevin
Unfortunately, I believe they're necessary. My exact code is a list of radio inputs, in template lanaguage and radio buttons use the input name as a way of grouping. My Models would be: class OptionSet(Model): name = CharField() class Option(Model): name = CharField option_set = Foreig

Re: Form Value Array

2005-11-22 Thread Kevin
I understand, and that's what I'm really doing at the moment, but I was just curious if there's a better way to retrieve these POST values than just: options = [] for name, value in request.POST.items(): if(name.startswith("option")): options.append(value)

Re: Form Value Array

2005-11-22 Thread Kevin
I decided to try writing a generic array converter as a middleware: import re class ParamsMiddleware: patt = re.compile("^([a-zA-Z_]\w*)\[\(d*)\]$") LARGE_INT = 2**30 def process_request(self, request): if(request.POST): post = requ

Re: ANN: new-admin branch merged to trunk

2005-11-25 Thread Kevin
Excellent, time to `svn switch` back to trunk

Re: is Django too powerful?

2005-12-14 Thread Kevin
I'd prefer to see a two stage approach to contributing applications to Django where newly contributed apps are in some sub-directory like django.extras instead of django.contrib that contains more standardized and popular applications like admin. I'm thinking of KDE as a model with there kdenonb

url hierarchy

2005-12-20 Thread Kevin
Hey guys, got myself stumped and I'm hoping you could help me figure this one out. In my code I've got a hierarchical category structure for my model that's intended to roughly analogize a filesystem, eg: class Album(meta.Model): location = meta.SlugField() name = meta.CharField() pa

Re: url hierarchy

2005-12-20 Thread Kevin
Yeah, after more experimenting, I came to the same conclusion and globbed the whole path and tokenized the names in the view. Thanks for the help.

SQL Injection

2005-12-20 Thread Kevin
Is there any builtin protection against SQL Injection in django? Let me present a common case I use: class Article(meta.Model): name = meta.SlugField() title = meta.CharField() text = meta.TextField() # my url conf (r'^articles/(?P.*)/$', 'mydomain.views.view_article') # my view d

Re: Django for eCommerce?

2005-12-22 Thread Kevin
I'm converting my custom PHP e-commerce site over to django. It's a dream writing in a true MVC framework with the python language and django's ORM and template language. I do all my payment processing offline, so I can't help on that topic. It's much easier to develop a product catalog with the

Search Functionality

2005-12-28 Thread Kevin
Could anyone provide some hints on how they have implemented search functionality on their web site? Did you do it django or use another middleware (eg, Lucene)? If you did it django, did you bypass the ORM and use direct SQL to take advantage of full text search? I'm currently trying to build

Re: Search Functionality

2005-12-31 Thread Kevin
That would be great. I think it would a strong benefit to many django users as search is such a common problem.

Re: making photo gallery

2006-01-05 Thread Kevin
For this exact use I created the following custom filter. It converts a list into a two-dimensional table: def tabularize(value, cols): """modifies a list to become a list of lists eg [1,2,3,4] becomes [[1,2], [3,4]] with an argument of 2""" try: cols = in

Re: making photo gallery

2006-01-06 Thread Kevin
Because without the map(None + ), your last row will be short elements if it doesn't divide pefectly. So, if you're cols was 3, you'd get: [(1,2,3), (4,)] and of course, that could create bad html: 1 2 3 4 So, now with the Map, the left over cells are set to None, so that's why the te

Validator across fields

2006-01-06 Thread Kevin
I'm sure this has been asked before, but googling didn't turn up a solution. I have the following class: class ContactInfo(meta.Model): name = meta.CharField() phone = meta.PhoneNumberField(blank=True) email = meta.EmailField(blank=True) And I'm trying to present a form to the user

Re: Managing static media urls

2006-01-20 Thread Kevin
I think the question at hand is not where to store and serve the media files, but how to write an app that can easily support accessing media files from different urls. I had this same issue between my development and production apache servers: Dev Site localhost/mysite/images/whatever.gif Prod

Re: Overthinking urls.py?

2006-03-29 Thread Kevin
I think the problem is that urlconf provides a url => view mapping. Really though, for creating the links, we need the reverse mapping. We usually know the view we want to display, but don't know it's URL. For example, you have a bulletin board app: urls.py: urlpatterns = patterns('' '^comm

Starting a new Python blog

2012-01-28 Thread Kevin
Hello Everyone, For sometime now I have been itching to create a Python blog, and now the fruits of my labor have paid off. I am ready to release the blog to the public eyes. At the moment it has 2 main features, a blog portion, and a bookmark system. Both the blog and the bookmark system off

Re: Starting a new Python blog

2012-01-29 Thread Kevin
gt; > > > > > > you have one subscriber over here and waiting to see more posts ;) > > > -- > > anler > > > On Sat, Jan 28, 2012 at 9:35 PM, Kevin wrote: > > >> Hello Everyone, > > >>  For sometime now I have been itching to create a Python

Re: Starting a new Python blog

2012-01-30 Thread Kevin
ally hurts navigation and overall usability. @Wc, I will make the change to open bookmarks in a new window/tab. There is also the live bookmark feature available for Desktop browser users, should work in all major browsers. Kevin On Jan 30, 7:47 am, Katie Cunningham wrote: > Have you consid

Re: Help Me With omab/django-socialauth

2012-02-03 Thread Kevin
Did you take a look at the example project? https://github.com/omab/django-social-auth/tree/master/example Compare it with your own project, or even use this example project as a base for your own project. If all your urls.py contains is "url(r'', include('social_auth.urls')), " and no other def

Middleware class to properly format arbitrary data

2012-02-14 Thread Kevin
Hello everyone, Before I go ahead and build a simple middleware for this myself, I would like to know if such a middleware already exists in the wild, so that I can prevent re-inventing the wheel. Here's an example, if nobody is following what the subject actually means: Say I have a view th

Re: Starting a new Python blog

2012-02-18 Thread Kevin
his blog will use the hash tag, #PythonDiary. If you wish to follow me on twitter, which may have the odd update, it's best to subscribe using RSS in your favorite reader or mobile app. My twitter handle is @kveroneau Kevin Veroneau PythonDiary.com On Jan 30, 11:46 pm, Kevin wrote: > @Aaron,

Adding 'extra_context' variable to Class-based views

2012-03-26 Thread Kevin
tml Hope it helps people on the migration path to Django 1.4. I am currently in the progress of migration, and will be writing some tutorials and blog posts about my experiences. Kevin. -- You received this message because you are subscribed to the Google Groups "Django users&

New release of Instant Django

2012-04-10 Thread Kevin
n a CDN(Content Delivery Network), which means all users regardless of their region will be-able to download the file at very fast speeds(does depend on your local connection, don't expect fast on your 56k). Kevin Veroneau -- You received this message because you are subscribed to the Google G

Re: Is it a good practice to delegate views based on GET / POST?

2012-04-10 Thread Kevin
Separating GET and POST is normally used for RESTful web programming. Which is becoming a very common practice is popular competing frameworks, such as Rails. Personally I would prefer a more "native" way in Django to separate GET/POST views. I guess this could be done via a decorator or some

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-15 Thread Kevin
Check out PyPy Sandboxing, it may be your best bet: http://pypy.org/features.html#sandboxing On Saturday, 14 April 2012 11:45:41 UTC-5, Arruda wrote: > > Hi there, I'm doing a system where I want the users to be able to > set/change some scripts that are dynamically run(RPG like scripts). > So

Re: Password protected URLs Django - choose which to be protected also in admin

2012-04-15 Thread Kevin
Depending on how you are building your application, you have a few options here: - If you need to protect specific rows in a database to only a handful of users, and make this configurable in admin site, use something like django-guardian to provide row-level permissions. - If you absolutely n

Re: Working Hello World Ajax example via django pleeeease

2012-04-15 Thread Kevin
Here you go, a fully working AJAX "Hello World" example in Django: http://www.dajaxproject.com/dajaxice/ I use both Dajax and Dajaxice for a few projects of mine, check out my profile site for a fully working AJAX website made in Django: http://iamkevin.ca/ Django even has specific form widget

Calling model methods from templates

2012-07-06 Thread Kevin
I'm fairly new to Django/Python so please bear with me. I want to create some methods in my models that return boolean values (has_employees, etc) but I cannot seem to access the return value in the template. Here's a cut-down example: Model: def fcnTrue(): return True View:

Re: Calling model methods from templates

2012-07-06 Thread Kevin
endif %} (I realize the method must be called on an instance, and that's what I'm doing but failed to illustrate in my first post) On Friday, July 6, 2012 2:26:22 PM UTC-5, Kevin wrote: > > I'm fairly new to Django/Python so please bear with me. > > I want to create some

Re: Calling model methods from templates

2012-07-06 Thread Kevin
> in that method definition? TypeErrors would fail silently in the templates > > > -Mensaje original- > De: Kevin > Enviados: 06/07/2012 16:37:04 > Asunto: Re: Calling model methods from templates > > I should mention this is happening in a loop iterating ov

Incorrect post URL on failed form validation

2012-07-13 Thread Kevin
corrected form it posts to myapp/addNewRow/addNewRow/3 which is obviously not what I want. Any suggestions? Thanks much! Kevin -- 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.goog

Incorrect post URL on invalid form submissions

2012-07-13 Thread Kevin
corrected form it posts to myapp/addNewRow/addNewRow/3 which is obviously not what I want. Any suggestions? Thanks much! Kevin -- 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.

Re: Incorrect post URL on invalid form submissions

2012-07-13 Thread Kevin
I refactored this into a single view (similar to the Django form example) and it's working fine...not to mention it's much more DRY. Feel free to disregard! Kevin On Friday, July 13, 2012 3:00:03 PM UTC-5, Kevin wrote: > > I'm new to Django so hopefully this will be tr

Posting from HTTP to HTTPS on same domain results in CSRF failure

2012-10-31 Thread Kevin
Hello everyone, I am in the process of deploying a Django app which works both on HTTP and HTTPS connections, and require that some specific forms only submit via HTTPS. I want the transition process over to HTTPS to be seamless for the end-user. I am implementing this on a site-wide login

Re: CBV for Nested Formesets

2012-11-11 Thread Kevin
os-class-based-views.html Best Regards, Kevin Veroneau On Friday, 9 November 2012 12:55:13 UTC-6, Lee Hinde wrote: > > I'm looking at these two blog posts to help me figure out nested formsets: > > http://yergler.net/blog/2009/09/27/nested-formsets-with-django/ > > http:

How many developers have moved to class-based views?

2012-11-11 Thread Kevin
e a little while to properly understand how they worked and what functions to override to do specific tasks. This mainly involved reading the source code to see how everything worked. Best Regards, Kevin Veroneau Python Diary -- You received this message because you are subscribed to the Goo

Using os.fork() in a Django view

2011-08-18 Thread Kevin
Hello everyone, Firstly, I've been using Django for quiet sometime now and have created a few projects and many of my websites run it. I am wanting to take my Django management to the next level, and need to use the os.fork() function, here's why. I am planning on developing a web control pa

Re: Using os.fork() in a Django view

2011-08-19 Thread Kevin
g 19, 2:24 am, Roberto De Ioris wrote: > Il giorno 19/ago/2011, alle ore 08:46, Kevin ha scritto: > > > Hello everyone, > > > Here's the code I will be needing to run in a os.fork(): > > from django.core.management import setup_environ, call_command > > import set

Pickling a QuerySet

2011-09-02 Thread Kevin
An interesting question here, not sure if anybody has tried to pickle their QuerySets before. Here's an example that does work: entry_list = Entry.objects.all() response = HttpResponse(pickle.dumps(entry_list),mimetype='application/x- pickle.python') response['Content-Dispo

Re: Pickling a QuerySet

2011-09-02 Thread Kevin
data? As it currently stands it will overwrite existing data with the new values contained in the pickle. This would definitely be an interesting take on data backup or even migration to a new database server. On Sep 2, 5:05 am, Kevin wrote: > An interesting question here, not sure if anybody has

Re: Multiple Database Routing Based on Site

2011-09-02 Thread Kevin
The only solution I can directly think of, since the SITE_ID is in settings.py would be to use some python logic to determine the database for that site. eg. if SITE_ID == 1: ... Database settings for site 1 here ... Use an if-then like this in your settings.py. Now if what your going after

Re: Pickling a QuerySet

2011-09-02 Thread Kevin
On Fri, Sep 2, 2011 at 11:05 AM, Kevin wrote: > > An interesting question here, not sure if anybody has tried to pickle > > their QuerySets before. > > Not only have people tried this before, but there is an entry in the > manual about it: > > https://docs.djangoproject.c

Helping someone move from Joomla to Django

2011-09-28 Thread Kevin
Hello, I have a friend who is doing website design, not any backend programming tasks. He actually would like me to do the backend coding. The unfortunate case is that he is currently using Joomla, which I know almost nothing about, and the apps/plugins for it are not reusable in other website

Re: Community Wiki/CMS app

2011-09-28 Thread Kevin
I will recommend using Pinax for this particular type of site. http://pinaxproject.com/ I am not sure if Pinax has an included Mailing list app, but there should be one available at djangopackages.com If Pinax is a little too much, try out Django-cms: https://www.django-cms.org/ Django-CMS eve

Re: Media wiki

2011-09-28 Thread Kevin
You can see a list of all available Django wiki software here: http://www.djangopackages.com/grids/g/wikis/ Also note that Pinax also comes with a wiki App you can use as well, plus many other features. On Sep 28, 6:17 am, Anoop Thomas Mathew wrote: > Hi, > > If you want a basic wiki, you can t

Re: Community Wiki/CMS app

2011-09-29 Thread Kevin
opers from PyCon itself. On Sep 28, 9:26 am, Thomas Guettler wrote: > Am 28.09.2011 10:08, schrieb Kevin: > > > I will recommend using Pinax for this particular type of site. > > >http://pinaxproject.com/ > > > I am not sure if Pinax has an included Mailing list app,

MAPI Email Backend available for testing

2011-10-03 Thread Kevin
I noticed that Django does not include a MAPI Backend for sending Email, for some environments having this type of backend is essential for testing and debugging. I do not recommend it as a production backend unless you are a full exchange shop, as some are and do not offer SMTP for internal appli

Re: MAPI Email Backend available for testing

2011-10-03 Thread Kevin
Recipients(mapi.MODRECIP_ADD,pal) message.SetProps([(mapitags.PR_BODY_A,email_message.message().as_string()), (mapitags.PR_SUBJECT_A,'Django sent message')]) self.connection.SaveChanges(0) message.SubmitMessage(0) return True On Oct 3, 4:01 a

Re: Helping someone move from Joomla to Django

2011-10-06 Thread Kevin
I might say just 'WOW!'... I just took some time to go over the Joomla documentations to see what I was up against. Why do developers even use this thing? Sure maybe the frontend is nice and polished, but the backend looks horrible, at least compared to Django. Django code looks much more clean

Re: Beginner a bit lost - need some pointers please

2011-10-06 Thread Kevin
For that it's worth, I deploy my Django projects using Nginx and FastCGI. I find this solution to be working rather nicely, Nginx takes care of serving all the static content really fast and passes the app requests to Django. It's really quick and easy to set-up too. I prefer Nginx as I can bett

Re: Your Impressions on DjangoCMS

2011-10-07 Thread Kevin
I don't have any professional experience with Django-CMS, however I did dive into it and try out their demo site and even test out an installation myself on a server. My first impressions via the demo site they provided were very good, I enjoyed the feel of it and how easy it was to add content an

Re: Need advice on ForeignKey query problem.

2011-10-11 Thread Kevin
What your looking for is here in the documentation: https://docs.djangoproject.com/en/1.3/topics/db/queries/#related-objects records = models.Facility.objects.get(pk=62).schedule_set.all() On Oct 10, 8:19 pm, "Sells, Fred" wrote: > I've got these two tables defined where a Facility can have mult

Re: Ajax replacement in django

2011-10-17 Thread Kevin
Just a simple thought, if you'd prefer to avoid JavaScript/client-side scripting entirely, and only code using Python. It might be an idea to look at Pyjamas to generate your page. It technically uses Ajax, but from the programmers point of view, it feels more like coding a desktop application.

Re: Blank output from treemenus under nginx

2011-10-17 Thread Kevin
This is rather common when moving over from the dev server to a production environment. Sometimes it can be tricky to map all the static URL paths in the web server serving the static content, such as the JavaScripts which treemenus uses. I haven't used treemenus before, but from past experiences

Getting into professional django development

2011-10-17 Thread Kevin
Hello everyone! I have been using Django for about a year now and feel that I want to take my experience to the next level. I have created a few website using Django to test my skills, although not for anyone specific. I am creating this thread as I will like to ask current Django website deve

Re: Getting into professional django development

2011-10-18 Thread Kevin
Thank you all for your great feedback! I will definitely take Andre's to-do list there, I hear REST is definitely something to master. I've been needing to learn Celery for a project I want to work. I have worked with caching, although I do not see myself as a master, I do know my way around the

Re: Django admin multiple company accounts

2011-10-20 Thread Kevin
There is no need to implement the same CRUD over and over again with the help of generic views and signals. :) https://docs.djangoproject.com/en/1.3/ref/class-based-views/ Mind you, I've only used these generic views in 1.2 and never yet took some time to learn the new class-based one. Although

Re: Blank output from treemenus under nginx

2011-10-20 Thread Kevin
easily stop the instance using kill `cat /var/run/django/instance.pid`. Be sure that the user running your django instance can write to the sub-directory in /var/ run. Create a subdirectory, don't just give the user full access to / var/run. On Oct 18, 3:51 am, Alastair Campbell wr

Re: Getting into professional django development

2011-10-20 Thread Kevin
I have a similar development machine set-up, for hosting, I am currently using Rackspace Cloud, as I have full control over deployment options, and it can grow with my apps, scalability is a must. I am currently using Debian Squeeze and editing with the wonderful Kate, and using KIO to edit the od

Storage Backend for MediaTemple's ProCDN?

2011-10-22 Thread Kevin
I have a client who is suggesting that I look into MediaTemple's ProCDN. I currently only have experience with RackSpace's CloudFiles CDN, and only know of it and Amazon S3 for django storage support. Furthermore, I cannot seem to access their API pages without having a login, so this complicates

Re: Storage Backend for MediaTemple's ProCDN?

2011-10-23 Thread Kevin
et him/her see why a > specific provider might be the best to use. Sure, MediaTemple *might* > be the cheapest to host (I don't know, just assuming) but if there's > no existing tools to use them as a storage backend, it might cost your > boss thousands of dollars (equivalent to

Comparing two ManyToMany fields for same entries

2011-10-28 Thread Kevin
Hello, I am building a model which shares a relation with another model using a ManyToManyField. What I need to do, is find out which models are on both on two seperate ManyToManyField lists. Here is a simple example of what I am trying to do: Person: friends=ManyToManyField(self) To find

Re: Comparing two ManyToMany fields for same entries

2011-10-28 Thread Kevin
plained it properly. Thanks. On Oct 28, 12:30 pm, Kevin wrote: > Hello, > >   I am building a model which shares a relation with another model > using a ManyToManyField.  What I need to do, is find out which models > are on both on two seperate ManyToManyField lists.  Here is a simp

Re: Comparing two ManyToMany fields for same entries

2011-10-28 Thread Kevin
8, 1:21 pm, Brett Epps wrote: > Try this: > > for friendof0 in Person0.friends.all(): >     for friendof1 in Person1.friends.all(): >         if friendof0 == friendof1: >             # Person 0 and Person 1 share a friend. >         else: >             # They have no shared frie

Re: Comparing two ManyToMany fields for same entries

2011-10-28 Thread Kevin
depth=2) option? I am trying to make sure the database hits are optimized as this will be queries multiple times per page hit for different models. Also, which would be faster to make sure the page loads are not burden when lots of these types of queries go through? Thanks. On Oct 28, 1:34 pm,

Pickling and caching the current request.user, good or bad idea?

2011-10-29 Thread Kevin
In my attempts to lower database hits, I found that on most of my pages, auth_user is hit every time. I had an idea about caching this object in the current session. Is this a good idea, or will it cause more problems than it helps? If so, what type of problems will I be looking at? My app rare

Re: Pickling and caching the current request.user, good or bad idea?

2011-10-29 Thread Kevin
extra "if" instead of copying the same line to set the request variable twice. On Oct 29, 5:45 am, Kevin wrote: > In my attempts to lower database hits, I found that on most of my > pages, auth_user is hit every time.  I had an idea about caching this > object in the current ses

Re: Comparing two ManyToMany fields for same entries

2011-10-29 Thread Kevin
riends" T4 ON (T3."id" = T4."from_person_id") INNER JOIN "relations_person" T5 ON (T4."to_person_id" = T5."id") WHERE ("relations_person"."name" = Person1 AND T5."name" = Person0)LIMIT 21 I'll need to

Django tutorial hasn't received an update for 1.3

2011-10-31 Thread Kevin
I keep checking the tutorial page for version 1.3 hoping to see some new content related to the class-based views or at least some of the promised future tutorials. The tutorial still has the function-based views, and no new updates since I first went through it on the 1.2 release. I know the fun

  1   2   3   4   5   >