Re: installer

2011-04-24 Thread Mike Dewhirst
On 25/04/2011 5:14am, ydjango wrote: Thanks Mike, I will use what you suggested as interim step and to automate my own processes. I want to provide it as shrink wrapped downloadable software that customer can install via guided install. And I do not want provide the source code. Bit out of my

Re: Checking for user type in view

2011-04-24 Thread Mike Dewhirst
On 25/04/2011 7:15am, Kenny Meyer wrote: Hello guys, In my application models I have two models, Judge and Participant: Another way might be to use django groups. Have a participant group and a judge group and pop your users into one or the other. I prefer this approach for my own purposes

Re: How to register EmployeeAdmin using atributes in Person class

2011-04-24 Thread Ernesto Guevara
I still having a little problem using OneToOne relationship and Edit form. The forms are created with combobox and get all address in database, i need the address of the specific Employee only. Anybody know fix this problem? Thanks! 2011/4/23 Guevara > I got put in the form of employee the for

Re: avatar or thumbnails

2011-04-24 Thread Eric Hutchinson
PIL (Python Imaging library) is the engine that pretty much powers this functionality on most sites. TO make it easier, look at the sorl and imagekit apps, they do all the heavy lifting for you. On Apr 24, 10:20 pm, xeed wrote: > hi im noob in django, i need help, i want have an avatar or thumbn

avatar or thumbnails

2011-04-24 Thread xeed
hi im noob in django, i need help, i want have an avatar or thumbnail in my project, but i have nothing idea how i can integrate in my project, I have python 27, and django 1.3 i need a sample project with avatar or thumbnail inside the sample, then i will see how integrate in my project. thks a l

Re: Ajax headers not work in all browsers?

2011-04-24 Thread Daniel França
Here's the header in request as seen from Firebug: Request Headers Hostlocalhost:8000User-Agent Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0) Gecko/20100101 Firefox/4.0Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language en-us,en;q=0.5Accept-Encodinggzip, deflate

Re: Checking for user type in view

2011-04-24 Thread Kenny Meyer
On Sun, Apr 24, 2011 at 5:23 PM, Shawn Milochik wrote: > It's not recommended that you subclass User. > > Better: Create a class to use for a user profile and associate it with > the User using the instructions here: > > http://docs.djangoproject.com/en/1.3/topics/auth/#storing-additional-informat

Re: Checking for user type in view

2011-04-24 Thread Kenny Meyer
> I have done the following, and it works most of the time for me: > > def index(request): >    user = request.user >    if user.is_authenticated(): >        if user.is_superuser: >            return redirect('/admin') > >        judge = None >        participant = None >        competition = None

Re: Checking for user type in view

2011-04-24 Thread Shawn Milochik
It's not recommended that you subclass User. Better: Create a class to use for a user profile and associate it with the User using the instructions here: http://docs.djangoproject.com/en/1.3/topics/auth/#storing-additional-information-about-users Then give that class a 'role' field or something

Checking for user type in view

2011-04-24 Thread Kenny Meyer
Hello guys, In my application models I have two models, Judge and Participant: from django.contrib.auth.models import User class Judge(User): pass class Participant(User): pass In my view I want to find out if the authenticated user is either a Judge or a Participant. How can

Re: installer

2011-04-24 Thread ydjango
Thanks Mike, I will use what you suggested as interim step and to automate my own processes. I want to provide it as shrink wrapped downloadable software that customer can install via guided install. And I do not want provide the source code. What would be the best way to do it? - Any tools that

Re: Ajax headers not work in all browsers?

2011-04-24 Thread Daniel França
There are some django middleware classes to test the browser compatibility, can it be a problem? There's no cross domain call, it's all about my domain =/ It's necessary to set the mimetype in a get/load method? What else information can I post here to help? On Sun, Apr 24, 2011 at 2:44 AM, Maskl

Re: Ajax headers not work in all browsers?

2011-04-24 Thread Carl Nobile
It is not exactly clear what your issues are, so I will make a guess that it is HTTP headers (mimetype). For JSON it should be application/ json, but IE will not work with this even thought it is the required standard. The solutions to this is to generally use IFRAME's which means rethinking you im

URLs in error messages from form validation

2011-04-24 Thread Daniel Gerzo
Hello all, say I have a following form: class MyForm(forms.Form): id = forms.IntegerField(max_length=9) language = forms.CharField(max_length=10) file = forms.FileField() And a following pseudo clean method: def clean(self): for file in self.files.values():

Re: cx_Oracle error: ImproperlyConfigured

2011-04-24 Thread Ian
On Apr 23, 12:29 pm, kamal sharma wrote: > No it was .profile of mine. Now I have set the LD_LIBRARY_PATH in app.wsgi > as mentioned below and when I print the os.environ in the beginning of > views.py then it shows that newly added value. It's clear that your LD_LIBRARY_PATH is fine at this poin

Re: django 1.1 performance versus django 1.2 performance

2011-04-24 Thread Alexander Schepanovski
I am experiencing considerable performance problems with ORM requests, too. In django 1.2.3. And I found two slow procedures: first is queryset cloning (sql.Query objects deepcopying is actually slow) and second - sql generation (especially, generating list of fields). Both could be a result of ad

Re: extending a shopping cart

2011-04-24 Thread razafy
The model vs name issue has to do with lower case vs capitalized letters . To get the model attribute look up info in_meta.fields On Apr 23, 9:52 am, shofty wrote: > ok, answering my own question here, kind of. > > attempt 1. > # get the objects for this content type, then choose the objec

Re: Connecting to a database

2011-04-24 Thread José Pablo Méndez Soto
Thanks Mate, Have a good one! ** On Sun, Apr 24, 2011 at 6:53 AM, Andrew Volozhanin wrote: > yes, SQLite doesn't use any SQL server. It consists of a database file. > That's why you access sqlite databases by the filename. > But mySQL, postgresql use such servers. And you access them by connect

Re: Connecting to a database

2011-04-24 Thread Andrew Volozhanin
yes, SQLite doesn't use any SQL server. It consists of a database file. That's why you access sqlite databases by the filename. But mySQL, postgresql use such servers. And you access them by connecting to these servers. -- You received this message because you are subscribed to the Google Group

Re: Connecting to a database

2011-04-24 Thread José Pablo Méndez Soto
That makes sense. Can you please tell me then, if os.path.dirname(os.path.abspath( __file__ )) + '/ database/local.db', would be something relative to SQLite? Many thanks *José Pablo Méndez * On Sun, Apr 24, 2011 at 1:34 AM, Daniel Roseman wrote: > On Sunday, April 24, 2011 7:46:43 AM UT

Re: extending a shopping cart

2011-04-24 Thread shofty
yeah, think i've found it. .model_class() worked, but game a strange result, so needs more investigation. thanks for the pointer mate. On Apr 23, 4:33 pm, Shawn Milochik wrote: > Did you check out the docs for adding a generic foreign key to your > model itself? -- You received this mess

Re: Connecting to a database

2011-04-24 Thread Daniel Roseman
On Sunday, April 24, 2011 7:46:43 AM UTC+1, Hurin wrote: > > Hi, > > I have a python script where I have to fill the following info to > connect to my DB: > > DATABASES = { > 'default': { > 'ENGINE': 'sqlite3','mysql', # Add 'postgresql_psycopg2', > 'postgresql', 'mysql', 'sqlite3