Re: DRY - fixing some duplicate code

2009-03-20 Thread adelevie
I didn't take a detailed look at the code, but can't you just make a function that is called by both view functions? On Mar 20, 12:15 pm, nerdydork wrote: > I have the following two functions (not complete, but should give you > an idea of what I'm

continuously gathering feeds

2009-03-08 Thread adelevie
I am building an app that uses the python-twitter module (a python library for twitter's api). I want to gather data from the public timeline which is updated about every minute. I have a function that given a feed will store it in the db. What is a good approach to making it so this function

Re: Set a URL to be handled by PHP

2009-02-21 Thread adelevie
You could also create a rest-like interface with php if all you're really doing with php is server side processing. On Feb 20, 9:08 am, Matt McCants wrote: > Hey there, > > Try setting the Handler to None just like you do with your media > directory. With a basic PHP

Re: how to make a field uneditable in admin site

2009-02-18 Thread adelevie
According to Djangobook, the philosophy of the admin site is that all users of it are "trusted" not just "authenticated," meaning you will trust them to do the right thing. On Feb 18, 8:42 pm, mermer wrote: > You need to create a custom ReadOnlyField that subclasses the

trouble with django-admin.py

2009-02-18 Thread adelevie
This used to work fine until around the time I upgraded from python 2.5 to 2.6. I use a windows pc. When I cd into the directory that I want to start my project in I type "django-admin.py startproject somesite" and get the Windows "choose program to open file" list. What is a starting point

Re: newbie : bring variables from template to view

2009-02-15 Thread adelevie
Have you learned ajax? On Feb 15, 9:32 am, arbi wrote: > Hi, > > In my template I call a javascript function that returns a dictionary. > I would like to bring back the 2 elements of this dictionary in my > view to make some work on it. > How to do it? Use forms? how? > >

Re: dev server not loading localhost urls

2009-02-03 Thread adelevie
access my api through a browser, I use localhost:8000. On Feb 3, 6:15 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Tue, Feb 3, 2009 at 5:54 PM, adelevie <adele...@gmail.com> wrote: > > > I am making an api. Part of the api involved serializing data which > > will t

dev server not loading localhost urls

2009-02-03 Thread adelevie
I am making an api. Part of the api involved serializing data which will then be deserialized on another machine. Since I am using the dev server, I wrote a view that referenced the api, ie: def someview(request): data = urllib2.urlopen("http://localhost:8080/some_method/? param=foo")

Re: mptt usage

2009-02-03 Thread adelevie
mptta is slow as hell On Feb 3, 4:50 am, vicalloy wrote: > I think mptt have good doc.http://code.google.com/p/django-mptt/ > mptt just a set of function to build tree efficient. > > 2009/2/3 Muslu Yüksektepe : > > > i did try it too but i deleted.

Re: Using authenticated users id in models

2008-12-17 Thread adelevie
I'm also somewhat of a beginner, but here goes... You might want to separate your model from your view a bit more. http://dpaste.com/hold/100082/ On Dec 17, 11:08 am, abidibo wrote: > Hi all, > I'm a beginenr with Django and Python and I'e have a problem I didn't > reached

Re: Preserving pretty HTML output

2008-12-03 Thread adelevie
You may also want to look at BeautifulSoup. It is an html parser writter for python. It has a method called soup.prettify() in which "soup" is a string of html. prettify() outputs cleanly formatted html. Approximation: soup = "titlehello world" soup.pretiffy() >>>

cascading drop down lists

2008-11-16 Thread adelevie
Hi. I am creating a separate admin page than the built in one. This new admin site is meant to scrape data from my university's course catalog based on a given set of criteria. I want to use a series of drop down lists to define this criteria. For example, I want to first have to select the year.