Re: What is the Development Life Cycle of Django App?

2011-07-22 Thread Eyad Al-Sibai
Thanks! On Sat, Jul 23, 2011 at 4:04 AM, Mike Dewhirst wrote: > On 23/07/2011 12:31am, Eyad Al-Sibai wrote: > >> What is the Development Life Cycle of Django App? Should I start in >> implementing the models or the urls ... or what exactly? >> > > Best advice I know is in

Re: Custom Manager

2011-07-22 Thread Eyad Al-Sibai
Thanks a lot! On Sat, Jul 23, 2011 at 5:08 AM, Matt M wrote: > From The Definitive Guide to Django: > > "In short, a model’s manager is an object through which Django models > perform database queries. Each Django model has at least one manager, and > you can create

Re: Real Example

2011-07-22 Thread Eyad Al-Sibai
Thanks a lot! I appreciate it On Sat, Jul 23, 2011 at 5:33 AM, Peter Murphy wrote: > Eyad, > > Well, I'll be damned: > > http://www.djangosites.org/with-source/ > > It's good etiquette to say "thank you" at this point. ;-) > > Best regards, > Peter > > On Jul 23, 4:17 am,

Re: Real Example

2011-07-22 Thread Peter Murphy
Eyad, Well, I'll be damned: http://www.djangosites.org/with-source/ It's good etiquette to say "thank you" at this point. ;-) Best regards, Peter On Jul 23, 4:17 am, Phang Mulianto wrote: > you better find books in amazon. .. many ready to learn for you.. > On Jul 22,

Re: Custom Manager

2011-07-22 Thread Matt M
>From The Definitive Guide to Django: "In short, a model’s manager is an object through which Django models perform database queries. Each Django model has at least one manager, and you can create custom managers to customize database access. There are two reasons you might want to create a

Re: Method call when deleting FK in admin

2011-07-22 Thread Kejun He
try "admins.ModelAdmin" On Sat, Jul 23, 2011 at 5:07 AM, galgal wrote: > > > My models:class Spectacle(models.Model): > > title = models.CharField(max_length=100) > slug = models.SlugField(max_length=100 unique=False) > description = models.TextField() > class

Re: Custom Manager

2011-07-22 Thread Andre Terra
Managers operate on your model, so their methods usually call sgl queries on a model's database. As an example, assume a blog app with a Post model which, among other things has a BooleanField called 'draft'. You could then write a custom manager called PublishedManager that subclasses the

Re: django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-22 Thread Andre Terra
Didn't read the original question, so excuse me for not replying. And thanks/congrats on the new patch =) Cheers, AT On 7/22/11, Ricardo L. Dani wrote: > FYI i fixed that and post a patch in the ticket. > > Regards > > On Thu, Jul 21, 2011 at 9:21 AM, Ricardo L. Dani

Re: What is the Development Life Cycle of Django App?

2011-07-22 Thread Mike Dewhirst
On 23/07/2011 12:31am, Eyad Al-Sibai wrote: What is the Development Life Cycle of Django App? Should I start in implementing the models or the urls ... or what exactly? Best advice I know is in Practical Django Projects by James Bennett -- You received this message because you are subscribed

Django + PyPy = ?

2011-07-22 Thread Dmitry Pisklov
Hi all, Tried to use PyPy to run django and tried following this instructions: https://code.djangoproject.com/wiki/DjangoAndPyPy But with no luck - I'm getting this error when trying to run pypy manage.py: $ pypy manage.py runserver 'import site' failed Traceback (most recent call last): File

Method call when deleting FK in admin

2011-07-22 Thread galgal
My models:class Spectacle(models.Model): title = models.CharField(max_length=100) slug = models.SlugField(max_length=100 unique=False) description = models.TextField() class SpectacleGallery(models.Model): spectacle = models.ForeignKey(Spectacle) image =

Question about flatpages + registration required

2011-07-22 Thread eddie
Sorry for the question, but I can't seem to track down a place to start. I've got a fairly simple django site that includes flatpages. I'm trying to require authentication to view one or two of the flatpages (like I would with a .htaccess, for instance). When I go to the admin, and click the

limit foreignkey of queryset

2011-07-22 Thread Jonas Geiregat
Hello, How would I limit the results of a foreign key of a queryset ? Ie. I have the models Person and Task. I want to get all Person's but only get their 2 latest tasks. Person__task points to Task__name It's a ManyToMany Relationship. Jonas Geiregat jo...@geiregat.org -- You received

Re: Editor de textfield

2011-07-22 Thread Jussiê Vieira Toledo
sorry forgot the rest of the query correcting: js = ('/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce.js','/ static/grappelli/tinymce_setup/tinymce_setup.js',) On 21 jul, 23:08, Jussiê Vieira Toledo wrote: > Hello everybody! > > I am wanting to use the

Re: Editor de textfield

2011-07-22 Thread Jussiê Vieira Toledo
sorry forgot the rest of the query correcting: js = ('/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce.js','/ static/grappelli/tinymce_setup/tinymce_setup.js',) On 21 jul, 23:08, Jussiê Vieira Toledo wrote: > Hello everybody! > > I am wanting to use the

Re: Real Example

2011-07-22 Thread Phang Mulianto
you better find books in amazon. .. many ready to learn for you.. On Jul 22, 2011 10:41 PM, "Shawn Milochik" wrote: > On 07/22/2011 10:31 AM, Eyad Al-Sibai wrote: >> Hi! >> >> I want a real example of complete django application with source code >> to understand django better

Re: Database Design Question

2011-07-22 Thread nixlists
On Thu, Jul 21, 2011 at 5:35 PM, Marc Aymerich wrote: > > ups, I think it should be: > contract.products.filter(id=Y).values_list('rebate_pct', flat=True) > product.contractproduct_set.filter(id=X).values_list('rebate_pct', > flat=True) Thanks. The first one does not work

Re: a little help with the urls.py and views.py

2011-07-22 Thread Andre Terra
https://code.djangoproject.com/wiki/UsingTheMailingList On Fri, Jul 22, 2011 at 11:23 AM, Derick Felsman < derick.fels...@cbsinteractive.com> wrote: > bump > > On Jul 22, 12:15 am, Derick Felsman > wrote: > > extending from the example found here > > > >

Re: Recommendations for load testing/profiling a django site server?

2011-07-22 Thread Malcolm Box
On 22 July 2011 13:52, Jacob Kaplan-Moss wrote: > On Thu, Jul 21, 2011 at 5:03 PM, br wrote: > > I am running on a Linode 768 VPS and may have some stuff going live > > before too long. I'm wondering what the best way to guage whether I > > have enough

Re: problem with BooleanField form

2011-07-22 Thread ed
Ok. That last one actually worked. Just needed to a browser refresh to re-load the script. That's a total noob mistake. My bad. Thanks all :) On Jul 21, 10:49 am, ed wrote: > You mean like this: > >         var data = { >                 url: item.find("#id_url").val(), >  

Re: Help on Internationalization

2011-07-22 Thread bruno desthuilliers
On Jul 22, 3:35 pm, Dipo Elegbede wrote: > I'm not using views. Oh yes ? Then how do you serve your content exactly ??? But anyway: this function contains all (well, most of) you need to know to solve your problem. -- You received this message because you are

Re: What is the Development Life Cycle of Django App?

2011-07-22 Thread bruno desthuilliers
On Jul 22, 4:31 pm, Eyad Al-Sibai wrote: > What is the Development Life Cycle of Django App? Should I start in > implementing the models or the urls ... or what exactly? You should start with designing your app. Then whatever you implement first is up to you, and mostly

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Alexey Luchko
On 22.07.2011 17:32, dpapathanasiou wrote: So you're saying: have the function which handles the post-login request (i.e., defined in with LOGIN_REDIRECT_URL in settings.py and in urls.py to some corresponding views.py function) make that type check of user A/B, and simply redirect accordingly?

Re: Real Example

2011-07-22 Thread Shawn Milochik
On 07/22/2011 10:31 AM, Eyad Al-Sibai wrote: Hi! I want a real example of complete django application with source code to understand django better 1. Search Google, github, and bitbucket. 2. Read this: https://code.djangoproject.com/wiki/UsingTheMailingList -- You received this message

Re: Custom Manager

2011-07-22 Thread Shawn Milochik
On 07/22/2011 10:30 AM, Eyad Al-Sibai wrote: Hi! I still do not get the meaning of Manager or Custom Manager in Django... I am confused! If you've used the '.objects' attribute of a model you've used a manager. A custom manager would be a subclass of the standard manager. You can then

What is the Development Life Cycle of Django App?

2011-07-22 Thread Eyad Al-Sibai
What is the Development Life Cycle of Django App? Should I start in implementing the models or the urls ... or what exactly? -- 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

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread dpapathanasiou
Ah, ok, that makes sense -- I'm not sure if that's what Andre meant in the first place. So you're saying: have the function which handles the post-login request (i.e., defined in with LOGIN_REDIRECT_URL in settings.py and in urls.py to some corresponding views.py function) make that type check of

Real Example

2011-07-22 Thread Eyad Al-Sibai
Hi! I want a real example of complete django application with source code to understand django better -- 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

Custom Manager

2011-07-22 Thread Eyad Al-Sibai
Hi! I still do not get the meaning of Manager or Custom Manager in Django... I am confused! -- 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: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Andre Terra
On Fri, Jul 22, 2011 at 11:08 AM, dpapathanasiou < denis.papathanas...@gmail.com> wrote: > Without getting into what's "right" or "wrong", I can explain that the > two types of users are inherently different, i.e., not inheritable > from a common base class, so user profiles and permissions will

Re: a little help with the urls.py and views.py

2011-07-22 Thread Derick Felsman
bump On Jul 22, 12:15 am, Derick Felsman wrote: > extending from the example found here > > https://docs.djangoproject.com/en/dev/topics/db/queries/ > > what if i wanted to create a url where i would pass in a list of > authors (not necessarily a list but an

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Phang Mulianto
with user profile, i translate it this way : after user login,app check the profile of user then decide based on the profile which page sould user be redirected after login,say a to dashboard landing page, b user redirect to console page... why would create 2 login page for 1 project anyway.. On

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread dpapathanasiou
Without getting into what's "right" or "wrong", I can explain that the two types of users are inherently different, i.e., not inheritable from a common base class, so user profiles and permissions will not work, because functions in /dashboard views.py should never be accessed (or in a position to

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Andre Terra
No, there is no way to do that. I'm sorry, but your approach is convoluted and inherently wrong. Instead of asking "how can I make this solution work?" you should be asking "what's the best way to solve my needs?" and the answer to the latter will be very different from what you currently have in

Re: Help on Internationalization

2011-07-22 Thread Dipo Elegbede
I'm not using views. On 22 Jul 2011 12:48, "bruno desthuilliers" wrote: > On Jul 22, 10:47 am, Dipo Elegbede wrote: >> Hi All, >> >> I am working on a project of mine and it is doing very well. >> >> I want to give users the options to

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread dpapathanasiou
Thanks for your reply, but now that I've read up on custom profile and permissions, it doesn't seem like a solution. Here's another way of explaining it: in my urls.py file, I have two entries inside the urlpatterns definition, like this: (r'^dashboard/', include('mysite.console.urls')),

Re: Django AJAX polling: Best practice?

2011-07-22 Thread Shawn Milochik
On 07/22/2011 02:35 AM, PyPal wrote: Hi Shawn, I think you were referring to the APE ( http://www.ape-project.org/ ) framework as the 'gorilla' thingy... Yes, thanks! I did some Google searching but couldn't find it. Someone on the list said they were going to give it a shot, but I haven't

Re: django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-22 Thread Ricardo L. Dani
FYI i fixed that and post a patch in the ticket. Regards On Thu, Jul 21, 2011 at 9:21 AM, Ricardo L. Dani wrote: > Hi everyone, > > I have the same problem of this ticket from django trac: > https://code.djangoproject.com/ticket/7783 > > The PostgreSQL database

Re: Changes from 1.2.5 to 1.4 pre-alpha?

2011-07-22 Thread Jacob Kaplan-Moss
On Fri, Jul 22, 2011 at 4:36 AM, Rodney Topor wrote: > I've been away from Django for over 6 months.  Previously I was using > 1.2.5.  Now I'll be using 1.4 pre-alpha. > > Can someone please point me to a good summary of the main changes made > between these two versions? See

Re: Recommendations for load testing/profiling a django site server?

2011-07-22 Thread Jacob Kaplan-Moss
On Thu, Jul 21, 2011 at 5:03 PM, br wrote: > I am running on a Linode 768 VPS and may have some stuff going live > before too long.  I'm wondering what the best way to guage whether I > have enough bandwidth/CPU/memory to handle a significant amount of > traffic is and/or to

Static Files on IIS7

2011-07-22 Thread The Ape
Hi, I am running Django (1.3) with PyISAPIe (Python 2.6.6) on IIS7. I am using the Django tutorial pages as test sites. Now when I am trying to access the adminsite, the site is loaded without the static files (loaded via IIS7). When I use the Django development server the site is rendered

Re: Help on Internationalization

2011-07-22 Thread bruno desthuilliers
On Jul 22, 10:47 am, Dipo Elegbede wrote: > Hi All, > > I am working on a project of mine and it is doing very well. > > I want to give users the options to pick their language of choice using > internationalization and that has been a problem for me. > > I have read

Re: Still on Internationalisation

2011-07-22 Thread Baurzhan Ismagulov
On Fri, Jul 22, 2011 at 10:25:04AM +0100, Dipo Elegbede wrote: > $ django-admin.py makemessages -l de > processing language de > Error: errors happened while running xgettext on __init__.py > 'xgettext' is not recognized as an internal or external command, > operable program or batch file. You

Still on Internationalisation

2011-07-22 Thread Dipo Elegbede
I was trying to run a makemessages command and got the following error; can you please help? $ django-admin.py makemessages -l de processing language de Error: errors happened while running xgettext on __init__.py 'xgettext' is not recognized as an internal or external command, operable program

Help on Internationalization

2011-07-22 Thread Dipo Elegbede
Hi All, I am working on a project of mine and it is doing very well. I want to give users the options to pick their language of choice using internationalization and that has been a problem for me. I have read through the django documentations but cannot get a way around this, could you please

Re: Django AJAX polling: Best practice?

2011-07-22 Thread PyPal
Hi Shawn, I think you were referring to the APE ( http://www.ape-project.org/ ) framework as the 'gorilla' thingy... On Jul 3, 8:01 am, Shawn Milochik wrote: > On 07/01/2011 05:05 PM, Andreas Pfrengle wrote: > > > Thanks so far for showing me that I was on the completely

Editor de textfield

2011-07-22 Thread Jussiê Vieira Toledo
Hello everybody! I am wanting to use the TinyMCE editor automatically in fields of type TextField. To know that it is necessary to add a supplement in the middle class which is the Admin: class Media: js = But where is this middle class physically admin? Not found at all. I'm using Grappelli.

Re: Changes from 1.2.5 to 1.4 pre-alpha?

2011-07-22 Thread bruno desthuilliers
On Jul 22, 11:36 am, Rodney Topor wrote: > I've been away from Django for over 6 months.  Previously I was using > 1.2.5.  Now I'll be using 1.4 pre-alpha. > > Can someone please point me to a good summary of the main changes made > between these two versions? You may want to

Changes from 1.2.5 to 1.4 pre-alpha?

2011-07-22 Thread Rodney Topor
I've been away from Django for over 6 months. Previously I was using 1.2.5. Now I'll be using 1.4 pre-alpha. Can someone please point me to a good summary of the main changes made between these two versions? I've noticed that some of my projects no longer run, reporting (a) ADMIN_MEDIA_PREFIX

a little help with the urls.py and views.py

2011-07-22 Thread Derick Felsman
extending from the example found here https://docs.djangoproject.com/en/dev/topics/db/queries/ what if i wanted to create a url where i would pass in a list of authors (not necessarily a list but an unspecified number of different authors) and then query for an entry that has all of the

questionnaire

2011-07-22 Thread Coulson Thabo Kgathi
guys i want to tell my view that if a certail choice is selected end the questionnaire or skip to a certain question but i am failing tho retrieve the answer in the database here are my views and other files below. so below i want to access the "if_this_answer_go_to_page" field and check if