Re: What's the best way to develop an app that is similar the django admin?

2010-09-22 Thread Matthias Kestenholz
On Mon, Sep 20, 2010 at 3:13 PM, Federico Capoano wrote: > Hi all, > > I try to explain it clearly. > > I have to develop an application that will implement similar > functionality and look of the django admin, but in the frontend. > > So this application will have files management, clients manage

Re: How to use the given snippet..?

2010-09-22 Thread bruno desthuilliers
On 22 sep, 07:50, girish shabadimath wrote: > >>> from xxx.xxx import RequestFactory > >>> req = RequestFactory.request This looks up the name 'request' on the RequestFactory object and binds the result - here an unbound method object - to the name 'req'. > >>> req > > You want >>> req = Requ

How to use custom classes in django

2010-09-22 Thread jake2891
Hey guys, i am using extjs in django and am wondering the correct way to build custom classes like file upload classes and classes of functions. I am a bit confused does everything have to go into views.py by defining a function for each ajax request or what is the process? As with extjs like drop

Re: How to use custom classes in django

2010-09-22 Thread Daniel Roseman
On Sep 22, 9:10 am, jake2891 wrote: > Hey guys, i am using extjs in django and am wondering the correct way > to build custom classes like file upload classes and classes of > functions. I am a bit confused does everything have to go into > views.py by defining a function for each ajax request or

Re: How to use custom classes in django

2010-09-22 Thread jake2891
It doesnt need to be a class i am new to python / django and come from a php background so was just wondering what the best practice is? Is it to just put all requests and handling the savinf form data all into the one view.py? thanks for the reply On Sep 22, 10:48 am, Daniel Roseman wrote: > On

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-22 Thread Sithembewena Lloyd Dube
Thank you all for your contributions. I have resolved to give tinyMCE a go again. I am specifically using the django-tinymce application. On Wed, Sep 22, 2010 at 2:45 AM, Kenneth Gonsalves wrote: > On Tue, 2010-09-21 at 17:41 +0200, Sithembewena Lloyd Dube wrote: > > Has anybody intergrated a WYS

Re: filepath (system file system path) field

2010-09-22 Thread Nuno Maltez
On Tue, Sep 21, 2010 at 6:17 PM, pixelcowboy wrote: > Hi, I have seen this asked before here (without answers), but I wanted > to know how to go on about creating a field that stores filepath names > from the client filesystem, so I wanted to check if someone could > recommend the best apporach: C

Request object problem

2010-09-22 Thread girish shabadimath
hi all, i used django snippet http://djangosnippets.org/snippets/963/ and successfully created request object i checked the response.status_code its giving 200 i checked response.content it matches with the browser source code when i issue *response.template* it gives error and* response.cont

Re: help setting 'apps' folder Error: No module named registration

2010-09-22 Thread justin jools
add to settings.py: import os import sys PROJECT_ROOT = os.path.dirname(__file__) sys.path.insert(0, os.path.join(PROJECT_ROOT, "apps")) full article: http://codespatter.com/2009/04/10/how-to-add-locations-to-python-path-for-reusable-django-apps/ On Sep 21, 10:14 pm, justin jools wrote: > I hav

Re: Request object problem

2010-09-22 Thread bruno desthuilliers
On 22 sep, 11:31, girish shabadimath wrote: > hi all, > > i used django snippethttp://djangosnippets.org/snippets/963/ > > and successfully created request object > > i checked the response.status_code its giving 200 > > i checked response.content it matches with the browser source code > > when i

Sharding Scalability

2010-09-22 Thread Sudhakar
My router.py file is as below:- class shard_data: id = 0 class AppRouter(object): """A router to control all database operations on models in that belongs to a app in APPS_WITH_DB""" def db_for_read(self, model, **hints): "Point all operations on myapp models to 'other'"

Sharding Scalability

2010-09-22 Thread Sudhakar
My router.py file is as below:- class shard_data: id = 0 class AppRouter(object): """A router to control all database operations on models in that belongs to a app in APPS_WITH_DB""" def db_for_read(self, model, **hints): "Point all operations on myapp models to 'other'"

Re: Request object problem

2010-09-22 Thread girish shabadimath
Thanks for the reply, actually the response object got using RequestFactory is different from the one returned by client.get() function,, i think response object returned by client.get() supports response.template and response.context['data'],,, ref:( http://djangosnippets.org/snippets/963/ )

django-tagging - customize taggeditems admin page

2010-09-22 Thread German
Hi all! I'm using the django-tagging app (0.3). What is the best practice to customize the "taggeditems" admin page? (add search_fields, list_filter...). The only way is to modify the file \tagging\admin.py??? (I don't like this way) Thanks. -- You received this message because you are subscri

help setting 'apps' folder... path issue

2010-09-22 Thread justin jools
I am trying to run my apps from 'apps' folder and have 'apps.registration' installed apps/settings.py but the admin.py is having some problem with the path and I get error in admin: ImportError at /admin No module named registration.models Request Method: GET Request URL: http://devhead.alwaysd

simple relationship difficult?

2010-09-22 Thread jayfee
hello, so i've been running into a problem across a handful of frameworks, which is beginning to make me think i'm doing something dumb :-) so hopefully someone will be kind enough to set me on the right path. here's what i'm trying to do. i am creating a system that will be used to categorize ide

urls.py best practices

2010-09-22 Thread jayfee
so i'm using django to do some "CRUD" type stuff, but i'm avoiding using the generic create_update methods because i've found my relationships and data types don't always fit neatly enough to work. anyway, the piece that i'm trying to tackle now is getting a clean routing system going. here's how i

Re: Request object problem

2010-09-22 Thread bruno desthuilliers
On 22 sep, 13:17, girish shabadimath wrote: > Thanks for the reply, actually the response object got using RequestFactory > is different from the one returned by client.get() function,, The reponse object you get using RequestFactory is the one returned by your view. > i think response object re

Re: Request object problem

2010-09-22 Thread girish shabadimath
ya correct, now i got complete picture of client.get() and RequestFactory, On Wed, Sep 22, 2010 at 5:28 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > On 22 sep, 13:17, girish shabadimath wrote: > > Thanks for the reply, actually the response object got using > RequestFactory

Re: urls.py best practices

2010-09-22 Thread Brian Bouterse
Have you looked at REST style URI's? With REST the action (aka verb) is never contained in the URL and is instead enumerated by the HTTP method type (ie: GET, PUT, POST, DELETE). This produces a much cleaner, more useful, more straight

Re: Why Django Apps Suck

2010-09-22 Thread Russell Keith-Magee
On Wed, Sep 22, 2010 at 4:26 AM, klaasvanschel...@gmail.com wrote: > tl;dr > * Django Apps Suck. Your reply explaining why they don't is expected. > * Reuse of a lot of things doesn't suck. But the specific unit app, > meaning a bunch of models that can be modified and presented with > their model

Re: Why Django Apps Suck

2010-09-22 Thread Russell Keith-Magee
On Wed, Sep 22, 2010 at 11:53 AM, Ramdas S wrote: > > > On Wed, Sep 22, 2010 at 2:48 AM, Klaas van Schelven > wrote: >> >> Shawn: thanks >> Just started watching the video and I'm noticing my complaints are not >> unique. >> >> > Wow! I guess your definition of an app  and expectation of re-usuab

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-22 Thread Sithembewena Lloyd Dube
Hi folks, I implemented bagheera's suggestion and I seem to have run into a problem. The TimnyMCE javascripts are in the admin's js folder, but when I view source and click on the links in Firefox, the files cannot be found. This is odd because the paths to the scripts are correct. For example act

Re: How to use custom classes in django

2010-09-22 Thread Bill Freeman
Start with the tutorial (for python version 2.x) at python.org On Wed, Sep 22, 2010 at 4:56 AM, jake2891 wrote: > It doesnt need to be a class i am new to python / django and come from > a php background so was just wondering what the best practice is? Is > it to just put all requests and handlin

Re: help setting 'apps' folder... path issue

2010-09-22 Thread Shawn Milochik
It's probably your PYTHONPATH. Check the result of: echo $PYTHONPATH I'm guessing that your apps directory is not in the path. If not, you can add it to your path. export PYTHONPATH=yourdirectory:$PYTHONPATH -- You received this message because you are subscribed to the Google Groups "Djan

Re: Why Django Apps Suck

2010-09-22 Thread indymike
On Sep 21, 4:26 pm, "klaasvanschel...@gmail.com" wrote: > One thing that deserves extra stress is that apss should be easily > extendable. Exactly the fact that every customer want something that > is slightly different from the next is how we're able to provide > value. (This is also the reaso

Re: change ordering of objects/rows on change list view on admin

2010-09-22 Thread derek
The admin column headers should be "clickable" for you to sort in ascending/descending order. On Sep 19, 11:31 pm, rahul jain wrote: >  I mean graphically/directly on the UI itself. > > On Sun, Sep 19, 2010 at 2:29 PM, Sævar Öfjörð wrote: > > >http://docs.djangoproject.com/en/dev/ref/contrib/adm

Re: Possible to have dynamic drop down list in ModelForm?

2010-09-22 Thread derek
If you search this list and /or the web, you'll see a number of examples on how to do this. On Sep 19, 8:42 am, Andy wrote: > I have a model FieldReport that has, among other fields, these two > fields: > > -country > -city > > Both "country" and "city" are lists of choices. > > I want to have a

Re: Why Django Apps Suck

2010-09-22 Thread Klaas van Schelven
> I'm yet to see a genuine case of (a) -- every time I've seen (a), it's > really masked version of (b), (c) or (d). I disagree. I think there are very specific problems, that has not been adressed by any of the responses above. Let's focus on one for now: how to extend models in any given app. A

'ifequal' takes two arguments

2010-09-22 Thread Bradley Hintze
I am getting an ''ifequal' takes two arguments' error for this line: {% ifequal {{ param2_trunc_new.3.0 }} {{ param2.4.1 }} %} I believer those are indeed two arguments. What going on here? -- Bradley J. Hintze Graduate Student Duke University School of Medicine 801-712-8799 -- You received t

Re: 'ifequal' takes two arguments

2010-09-22 Thread Shawn Milochik
Try writing both values to the screen or standard out. It's always possible that one of them isn't being populated. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscr

Re: 'ifequal' takes two arguments

2010-09-22 Thread Shawn Milochik
Oh, and you don't have a space between those two variables, so it could be that they're running together and appear to be a single one. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegrou

Re: 'ifequal' takes two arguments

2010-09-22 Thread Daniel Roseman
On Sep 22, 4:48 pm, Bradley Hintze wrote: > I am getting an ''ifequal' takes two arguments' error for this line: > > {% ifequal {{ param2_trunc_new.3.0 }} {{ param2.4.1 }} %} > > I believer those are indeed two arguments. What going on here? > > -- > Bradley J. Hintze Don't put arguments within v

Re: help setting 'apps' folder... path issue

2010-09-22 Thread Bill Freeman
Or you can add it to sys.path in your settings.py file. On Wed, Sep 22, 2010 at 10:43 AM, Shawn Milochik wrote: > It's probably your PYTHONPATH. > > Check the result of: > > echo $PYTHONPATH > > I'm guessing that your apps directory is not in the path. If not, you can add > it to your path. > >

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-22 Thread Kenneth Gonsalves
On Wed, 2010-09-22 at 11:22 +0200, Sithembewena Lloyd Dube wrote: > > Thank you all for your contributions. I have resolved to give tinyMCE > a go > again. I am specifically using the django-tinymce application. never used that - I use plain tiny as mentioned in my previous mail -- regards Kenn

Re: Why Django Apps Suck

2010-09-22 Thread Klaas van Schelven
Ok, it actually turns out the above idea works. That is to say, with a minimal amount of weird tricks (an empty models.py, plugging in some app_labels in the right places). Of course: without the tricks it would be even better. http://bitbucket.org/vanschelven/extendible_app_experiment A few note

Re: Problem with ForeignKey()

2010-09-22 Thread Yo-Yo Ma
Anyone know how to do this? On Sep 21, 10:35 pm, Yo-Yo Ma wrote: > I have a model with: > > parent = ForeignKey('self', blank=True, null=True) > > In that model I've overridden clean() to contain: > > if self.parent: >     # Do some stuff > > It raises an attribute error saying that parent.pk doe

Re: Why Django Apps Suck

2010-09-22 Thread Elim Qiu
Thanks Russell Keith-Magee's comments. Very helpful. I think the main question is still about the whole architecture. I'm a WebObjects developer for many years. I think WebObjects' architecture is great: (1) EOModel: a set of propertyList files describes the mapping of database tables to sub

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-22 Thread bagheera
Dnia 22-09-2010 o 14:41:56 Sithembewena Lloyd Dube napisał(a): I implemented bagheera's suggestion and I seem to have run into a problem. The TimnyMCE javascripts are in the admin's js folder, but when I view source and click on the links in Firefox, the files cannot be found. This is od

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-22 Thread bagheera
Dnia 22-09-2010 o 14:41:56 Sithembewena Lloyd Dube napisał(a): btw, it's an ordinary, pure tinyMCE, downloaded directly from their website -- Linux user -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Passing data into django-registration

2010-09-22 Thread Adi
So I have this situation. I have users that register with the application. Prior to registration, they have to choose a pricing plan. So on page 1, there are 3 links that all link to register, but the first one is for a basic pricing plan, the 2nd for a premium and 3rd for enterprise. When they cli

Re: filepath (system file system path) field

2010-09-22 Thread pixelcowboy
That field seems to grab all the files in a given directory according to a set filtering. I actually just want to register the actual directory names, and possible launch a file picker for the user to select it. On Sep 22, 2:30 am, Nuno Maltez wrote: > On Tue, Sep 21, 2010 at 6:17 PM, pixelcowboy

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-22 Thread tricks...@googlemail.com
What do you have in your settings.py? Make Sure you have the following configs TINYMCE_JS_URL (default: settings.MEDIA_URL + 'js/tiny_mce/ tiny_mce.js') TINYMCE_JS_ROOT (default: settings.MEDIA_ROOT + 'js/tiny_mce') TINYMCE_DEFAULT_CONFIG (default: {'theme': "simple", 'relative_urls': False})

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-22 Thread Anton Danilchenko
Thanks. I have read this article. In my Form I have added validation for check phone numbers. All right - I show user error message if given incorrect phone number. This is simple. I need to save this phone numbers in model Phone if all phone numbers valid and all other fields in this form is va

parsing data by tags

2010-09-22 Thread jjdoom
hi, how can i change directory after parsing file by Tags from view.py. I'd like to save my changed file to another directory. thx -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.co

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-22 Thread Anton Danilchenko
Now I have next solution (but still need your help). 1) I have added to my form custom field CharField for render field as input 2) I have created Form method clean_phones() for check all values is valid 3) in views.py I have get field contents, split it by comma and delete all non-numbers. In

Problem in Customizing Admin Interface using RTI

2010-09-22 Thread Mahesh
Steps i followed, 1. downloaded TinyMCE for production from http://tinymce.moxiecode.com/. 2. Unzipped and uploaded to my web server (linux) 3. changed URLS.PY with proper path as i saved in my server 4. Created sub-directory as admin/flatpages/flatpage/custom_form.html (to redirect) 5. Books and w

Newbie template problem

2010-09-22 Thread Brendon
Hi all, How do i get the actual data for a form field in the DJango template? field.data does not seem to work all the time. I saw the following: http://yuji.wordpress.com/2008/06/12/django-how-to-get-only-the-data-from-a-form-field/ which is exactly what i want to do, but field.data seems to re

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-22 Thread Anton Danilchenko
Ihave found solution. I have changed only Form class: 1) added field for show text input field phones = forms.CharField() 2) I have create in my Form instance method clear_phones() where I check phones and save it all to database and get Phone model ids for this phone numbers. And return thi

Re: Why Django Apps Suck

2010-09-22 Thread Russell Keith-Magee
On Wed, Sep 22, 2010 at 11:31 PM, Klaas van Schelven wrote: >> I'm yet to see a genuine case of (a) -- every time I've seen (a), it's >> really masked version of (b), (c) or (d). > > I disagree. I think there are very specific problems, that has not > been adressed by any of the responses above. >

Re: simple relationship difficult?

2010-09-22 Thread Karen Tracey
On Wed, Sep 22, 2010 at 7:11 AM, jayfee wrote: > hello, so i've been running into a problem across a handful of > frameworks, which is beginning to make me think i'm doing something > dumb :-) so hopefully someone will be kind enough to set me on the > right path. here's what i'm trying to do. >

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-22 Thread Steve Holden
On 9/22/2010 4:30 PM, Anton Danilchenko wrote: > Ihave found solution. > > I have changed only Form class: > > 1) added field for show text input field > phones = forms.CharField() > > 2) I have create in my Form instance method clear_phones() where I > check phones and save it all to databa

Re: Why Django Apps Suck

2010-09-22 Thread Steve Holden
On 9/22/2010 8:36 AM, Russell Keith-Magee wrote: > Lastly, I can't deny that reusability has it's price. Engineering an > application to be reusable takes more effort and planning than > building an application as a once-off. Well, Unix certainly came a long way with this philosophy > The aim i

Is there a way to easily implement the 'choose box' in a many to many relationship within the admin site, similar to the 'Change User' interface

2010-09-22 Thread Markitos
For some reason django only provides a simple list in a many to many relationship displayed in the admin interface of model you've created yourself. To select multiple values from this list you need to hold the shift key down. Its so clumsy. The admin interface for maintaining the 'User Permissions

Re: Problem with ForeignKey()

2010-09-22 Thread Yo-Yo Ma
Any thoughts on this? On Sep 22, 10:47 am, Yo-Yo Ma wrote: > Anyone know how to do this? > > On Sep 21, 10:35 pm, Yo-Yo Ma wrote: > > > > > I have a model with: > > > parent = ForeignKey('self', blank=True, null=True) > > > In that model I've overridden clean() to contain: > > > if self.parent:

Re: Is there a way to easily implement the 'choose box' in a many to many relationship within the admin site, similar to the 'Change User' interface

2010-09-22 Thread Laszlo Antal
I think what you are looking for is filter_horizontal. Add it to your in your modeladmin class. lzantal On Sep 22, 2010, at 7:57 PM, Markitos wrote: > For some reason django only provides a simple list in a many to many > relationship displayed in the admin interface of model you've created > y

Re: How to use custom classes in django

2010-09-22 Thread Sam Lai
After revising python basics, here's how I'd structure it - On 22 September 2010 18:10, jake2891 wrote: > Hey guys, i am using extjs in django and am wondering the correct way > to build custom classes like file upload classes and classes of > functions. I'm assuming by 'file upload classes' you

Signals problem

2010-09-22 Thread Joel Klabo
I keep getting this import error and I can't figure out why? Any ideas would be greatly appreciated: http://dpaste.org/BgtI/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To u

Re: Signals problem

2010-09-22 Thread Joel Klabo
Update: http://dpaste.org/kK5p/ On Sep 22, 11:41 pm, Joel Klabo wrote: > I keep getting this import error and I can't figure out why? Any ideas > would be greatly appreciated:http://dpaste.org/BgtI/ -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: Signals problem

2010-09-22 Thread Russell Keith-Magee
On Thu, Sep 23, 2010 at 2:41 PM, Joel Klabo wrote: > I keep getting this import error and I can't figure out why? Any ideas > would be greatly appreciated: http://dpaste.org/BgtI/ It's a circular import problem. signals.py imports objects from models.py, and models.py imports objects from signals