Re: ZeroMQ / Mongrel2

2012-06-27 Thread esatterwh...@wi.rr.com
You could use WSGID to link mongrel2 with your django app. Its pretty nice and easy to get running. On Tuesday, November 8, 2011 4:10:02 AM UTC-6, Tom Evans wrote: > > On Mon, Nov 7, 2011 at 11:58 PM, Markus Gattol > wrote: > > > > Maybe sombody has given

locating the functionality behind the HTML element

2012-06-27 Thread Smaran Harihar
Hi Guys, I am new to Django and have completed the initial basic tutorials in the django doc. I am presently working on a pre-customized django application. I was wondering how I can use FireBug to locate the code in a specific element (like button). In the sense, in general the web development

Re: ManyToManyField is this right?

2012-06-27 Thread David Wagner
Thanks Tom. Is this the example your talking about, https://docs.djangoproject.com/en/1.4/topics/db/models/#intermediary-manytomany? If so, I think this should work... # Different groups and states that issue teaching certificates/licenses class IssuingAuthority(models.Model): name =

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 6/27/12 11:48 AM, David Wagner wrote: Looking at that I think I may need to add a foreignkey to cert_types relating to person since a person can have multiple certification types (NRA Instructor, CCL Instructor, etc). No. See below. On Wed, Jun 27, 2012 at 11:40 AM, David Wagner

Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-27 Thread Russell Keith-Magee
On Thu, Jun 28, 2012 at 12:37 AM, ferran wrote: > Hello django users, > > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL link" > how this: > > " > Referrer: http://www.marquezshop.com/es/catalogo/sales/ > Requested URL: /es/catalogo/sales/undefined/ >

Re: ManyToManyField is this right?

2012-06-27 Thread David Wagner
Ah, I think that makes sense. Sorry if I wasn't clear earlier on but yes, I am looking for instructors who are certified to teach a certain course. So basically a user could sign up and select some or none of the types of courses they are certified to teach this way other users who want to learn

Re: interpretting urls

2012-06-27 Thread Smaran Harihar
The doc did not give details for *r'^(?:index/?)?$'*, in (r'^(?:index/?)?$', 'geonode.views.index') Thanks, Smaran On Wed, Jun 27, 2012 at 4:16 AM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > > On Tuesday, June 26, 2012 6:52:06 PM UTC+2, Sam007 wrote: >> >> Hi, >> >> I am

Re: interpretting urls

2012-06-27 Thread Smaran Harihar
Going thru the doc link you gave, I did not understand the term middleware request processing? but if the incoming HttpRequest object has an attribute called urlconf (set by middleware *request processing*), its

Re: How to make a query?

2012-06-27 Thread galgal
I made it that way: prev_months = Article.objects.dates('add_date', > 'month').filter(add_date__lt=datetime.date(int(year), int(month), 1))[:5] > next_months = Article.objects.dates('add_date', > 'month').filter(add_date__gte=datetime.date(int(year), int(month) + 1, > 1))[:5] On Wednesday,

Translated urls and accept-language header

2012-06-27 Thread Jonas Geiregat
Hello, I've setup translated urls for some languages. The default language for django has been set to en-US. If you request a page /registration/ with nl-NL as Accept-Language header, I get a 404. I wasn't expecting such behaviour. Rather I was hoping I would be redirected to /registratie/

Re: How to make a query?

2012-06-27 Thread Nikolas Stevenson-Molnar
Use the 'dates' method: https://docs.djangoproject.com/en/dev/ref/models/querysets/#dates with "month" for the kind argument. You can filter the query first to restrict to last five months. E.g: >>> oldest = datetime.date.today()-datetime.timedelta(30*5) #roughly 5 months ago >>> months =

How to make a query?

2012-06-27 Thread galgal
I have a model Article. It has a datetime field, title and description. How can I get last 5 months from now, where there is at least 1 article added? Other words - how to get last 5 months which are not empty? -- You received this message because you are subscribed to the Google Groups

Re: ManyToManyField is this right?

2012-06-27 Thread David Wagner
Looking at that I think I may need to add a foreignkey to cert_types relating to person since a person can have multiple certification types (NRA Instructor, CCL Instructor, etc). On Wed, Jun 27, 2012 at 11:40 AM, David Wagner wrote: > i think I may just be over thinking

Re: ManyToManyField is this right?

2012-06-27 Thread David Wagner
i think I may just be over thinking this. The last time I did any significant coding for the web as pre-php5 and so this whole MVC thing is something to adapt too for sure. I think I need to start thinking of the Model in the same way I would design a database back in the day with phpMyAdmin. I

many "Broken INTERNAL link" with end string "/undefined/"

2012-06-27 Thread ferran
Hello django users, In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL link" how this: " Referrer: http://www.marquezshop.com/es/catalogo/sales/ Requested URL: /es/catalogo/sales/undefined/ User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko)

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 12-06-27 8:02 AM, David Wagner wrote: Thanks for all the replies and I think I'm getting it now but it gets more complex too. So NRA Licenses is essentialy going to become a type of several certifications. For instance. NRA Instructor * Home Firearm Safety Instructor * Refuse to be

Re: ManyToManyField is this right?

2012-06-27 Thread David Wagner
Thanks for all the replies and I think I'm getting it now but it gets more complex too. So NRA Licenses is essentialy going to become a type of several certifications. For instance. NRA Instructor - Home Firearm Safety Instructor - Refuse to be a Victim Workshop - and many more could

Re: ManyToManyField is this right?

2012-06-27 Thread j_syk
One to One is the right type for linking a user to a profile in the Django world. However I think you may be mixed up on the many to many. How you have it setup would lead to a User being connected to multiple License objects, each with a nra and ccl attribute. If I didn't realize what those

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 12-06-27 6:57 AM, David Wagner wrote: I'm a self taught programmer who hasn't done much of anything for years so please forgive me if this question is naive. I have a hard time sometimes understanding some of the lingo used by trained programmers. With that said, I'm having trouble

Re: ManyToManyField is this right?

2012-06-27 Thread Javier Guerra Giraldez
On Wed, Jun 27, 2012 at 8:57 AM, David Wagner wrote: > With that said, I'm having trouble wrapping my brain around the ManyToMany > and Many-To-One and OneToOne concepts. I'm trying to create a multi-select > option for a user profile in which a user can have multiple

Re: Where admin classes should be registered ?

2012-06-27 Thread Daniel Roseman
On Wednesday, 27 June 2012 08:54:07 UTC+1, Alireza Savand wrote: > > Hi > Common way to create [model|admin] classes is implement and create them in > [models|admin].py file. > But as standard non-django way is to create a python package named admin > for AdminClass es and create a file for

ManyToManyField is this right?

2012-06-27 Thread David Wagner
I'm a self taught programmer who hasn't done much of anything for years so please forgive me if this question is naive. I have a hard time sometimes understanding some of the lingo used by trained programmers. With that said, I'm having trouble wrapping my brain around the ManyToMany and

Re: Django 1.4 Why does the create project command create 2 identical folders

2012-06-27 Thread Joey Espinosa
They're actually both considered your project. One just holds everything, and the other has global settings. Here is the official explanation: https://docs.djangoproject.com/en/1.4/releases/1.4/#updated-default-project-layout-and-manage-py Relevant text: > *Django 1.4 ships with an updated

Re: interpretting urls

2012-06-27 Thread bruno desthuilliers
On Tuesday, June 26, 2012 6:52:06 PM UTC+2, Sam007 wrote: > > Hi, > > I am bit confused about what exactly do these urls imply in the url.py > > This is all documented here : https://docs.djangoproject.com/en/dev/topics/http/urls/ -- You received this message because you are subscribed to the

Re: Where admin classes should be registered ?

2012-06-27 Thread Alireza Savand
As your approach, at admin/__init__.py i have to from myapp.admin.ouradmin import * That means import all of the classes inside that files. On Wed, Jun 27, 2012 at 2:54 PM, Matt Schinckel wrote: > I generally register admin models where I define them, and then just >

Re: Getting tuple of (sql, params) from the ORM.

2012-06-27 Thread David Novakovic
Fantastic, that's exactly what I need.. thanks Jeremy! Yep, my first -users post :) On Tuesday, June 26, 2012 9:05:35 PM UTC+2, jdunck wrote: > > On Tue, Jun 26, 2012 at 11:40 AM, David Novakovic > wrote: > > Hey all, > > > > Is it possible to get a tuple of (sql,

Re: Where admin classes should be registered ?

2012-06-27 Thread Matt Schinckel
I generally register admin models where I define them, and then just import that file in admin/__init__.py If you are getting multiple registration errors, it may be that your app appears twice in sys.path (perhaps as app, and project.app?). That's generally a Bad Thing(tm). Matt. -- You

Re: admin page doesn't auto-refresh

2012-06-27 Thread Matt Schinckel
I've found that this is a fairly common situation. For instance, Location has an FK to Company, and then ManyToMany to StaffMember. But, only StaffMembers that have their FK set to the same Company should be selectable in their inline. This need not just be a ManyToMany thing, either. The

Re: Can't get date formatting right

2012-06-27 Thread Benedict Verheyen
On 27/06/2012 11:07, Benedict Verheyen wrote: >> > > I found a bug where there was a reference too > translation.activate(settings.LANGUAGE_CODE) > I tried this as the first line of code in the view, and then my date is > formatted correcly > and a date of format dd/mm/yy is accepted. > Is it

Using subclass of RegexValidator for form field

2012-06-27 Thread Darren Spruell
Django 1.3.1 Python 2.7.1 I'm attempting to subclass RegexValidator in my app's validators.py to supply specific 'regex' and 'message' attributes and finding that the field validation I'm attempting does not work. I figure I don't quite understand how to subclass this validator correctly, or else

Re: Can't get date formatting right

2012-06-27 Thread Benedict Verheyen
On 27/06/2012 10:42, Benedict Verheyen wrote: > Hi, > > I'm still struggling with getting dates formatted correctly without > formatting them myself. > I went over all docs again, still, I must be doing something wrong. > > I want to use the built in Django system that formats the date

Can't get date formatting right

2012-06-27 Thread Benedict Verheyen
Hi, I'm still struggling with getting dates formatted correctly without formatting them myself. I went over all docs again, still, I must be doing something wrong. I want to use the built in Django system that formats the date according to the locale. I try this on a Debian Linux Squeeze,

Django DB transactions and deadlocks with multiple WSGI processes

2012-06-27 Thread Michael Waterfall
When running Django with Gunicorn with multiple processes/workers I'm getting a deadlock issue with some of my manual MySQL database transactions. DatabaseError(1205, 'Lock wait timeout exceeded; try restarting transaction') My setup uses multiple databases, and my function needs to be

Where admin classes should be registered ?

2012-06-27 Thread Alireza Savand
Hi Common way to create [model|admin] classes is implement and create them in [models|admin].py file. But as standard non-django way is to create a python package named admin for AdminClass es and create a file for each admin class. But i couldn't find any standard way to register those admin

Re: Django 1.4 Why does the create project command create 2 identical folders

2012-06-27 Thread Sergiy Khohlov
first one name of the project second one name of the application. You had executed both command 2012/6/27 Python_Junkie : > When one creates a project with django-admin.py why is a second my site > folder created? > > Mysite > Mysite > polls > > Thanks in