Re: Data truncated for column 'user_id' at row 1

2007-05-23 Thread Michael Newman
Wow, Thanks for the quick reply. Here I was restructuring my SQL and everything and it was a simple name problem. On May 24, 2:19 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2007-05-24 at 06:10 +, Michael Newman wrote: > > This is appearing athttp://speakeasymag.com/staff/Mgne

Re: newforms: how to report multiple cross-field validation errors?

2007-05-23 Thread Malcolm Tredinnick
On Thu, 2007-05-24 at 08:13 +0200, Mario Graziosi wrote: > Great, I'll do that. I didn't realized that ValidationError might get a > list of error messages and not just a single error message. Well, just don't tell anybody that I told you or some of the heftier developers will take me out back a

Re: Data truncated for column 'user_id' at row 1

2007-05-23 Thread Malcolm Tredinnick
On Thu, 2007-05-24 at 06:10 +, Michael Newman wrote: > This is appearing at http://speakeasymag.com/staff/Mgnewman > > I have been adjusting the SQL a bit but really don't understand why > this error keeps appearing. I did a search and most people who had > this problem were dealing with Utf-

Re: newforms: how to report multiple cross-field validation errors?

2007-05-23 Thread Mario Graziosi
Great, I'll do that. I didn't realized that ValidationError might get a list of error messages and not just a single error message. Thanks for your help, Malcom. Malcolm Tredinnick wrote: > On Wed, 2007-05-23 at 10:16 -0700, mario wrote: > >> I'm using newforms library and it is really a gre

Data truncated for column 'user_id' at row 1

2007-05-23 Thread Michael Newman
This is appearing at http://speakeasymag.com/staff/Mgnewman I have been adjusting the SQL a bit but really don't understand why this error keeps appearing. I did a search and most people who had this problem were dealing with Utf-8 characters. This is an Id column from a foreignKey field, so it i

Re: Displaying data in the admin using list_display

2007-05-23 Thread Malcolm Tredinnick
On Wed, 2007-05-23 at 22:30 -0700, Greg wrote: > Malcolm, > So how do I call a method in my list_display? At some point I think I'm justified in saying "please read the documentation." I mean, this is all explained in the docs for list_display in the Admin class. That should be your first port of

Re: conditional block tag

2007-05-23 Thread Michael Newman
You can also not put anything inside of the {% block header %} and then when nothing is provided nothing will show up. On May 23, 11:15 pm, David Robinson <[EMAIL PROTECTED]> wrote: > I'm probably missing something about your question, and please excuse me > if that's the case, but wouldn't you b

Re: Solution to multiple models on one form?

2007-05-23 Thread Michael Radziej
On Sun, May 20, David Priest wrote: > > After bashing at it some more, I had to conclude I was out to lunch. > > It is killing me to wait for newforms. It's senseless for me to > learn old forms, but I'm having a helluva time making heads or tails > of newforms. Some things that I swear m

Admin page without formatting and looks

2007-05-23 Thread [EMAIL PROTECTED]
i have installed apache2 and django 0.96 with mysql. i have a small application installed with this setup. now when i start admin page it shows plain page without any look and feel. i can see it with django internal server. i read previous article on it and made some changes but still does not wor

Re: Displaying data in the admin using list_display

2007-05-23 Thread Greg
Malcolm, So how do I call a method in my list_display? Here is my models file class Manufacturer(models.Model): name = models.CharField(maxlength=200) manufacturerslug = models.SlugField(prepopulate_from=["name"]) description = models.TextField(maxlength=1000) de

Re: NEWBIE: joining two tables problem

2007-05-23 Thread [EMAIL PROTECTED]
The second method would probably have worked if you had put: {% for photo in emp.photo_set.all %} instead of {% for photo in emp.photo_set %} I always forget the .all at first ;) and have to go back and add it. On May 23, 3:13 pm, Rogelio <[EMAIL PROTECTED]> wrote: > On May 23, 3:10 pm, Rogel

Re: conditional block tag

2007-05-23 Thread David Robinson
I'm probably missing something about your question, and please excuse me if that's the case, but wouldn't you be able to do this: {% if header %} {% block header %}Page Heading{% endblock %} {% endif %} Dave Trey wrote: > I have an interesting case that I would like to get some input on

Re: user object in templates

2007-05-23 Thread Ben Jones
> it seems like I have no user object in my templates, which is weird, > as it comes w/ my request object, and I can access it in my views. In > other words, request.user.is_authenticated evaluates to True in my > views, but to False in my templates. See this thread: http://groups.google.com/gro

conditional block tag

2007-05-23 Thread Trey
I have an interesting case that I would like to get some input on, perhaps I am just thinking about it incorrectly. It seems useful to have a conditional statement which will check to see if a child template has populated a block. {% block header %}Page Heading{% endblock %} If the bl

Re: Best Place To Start Learning Django/Python

2007-05-23 Thread Doug Van Horn
It's probably a little bit more advanced, and it's certainly not a tutorial, but the Python Challenge (http://www.pythonchallenge.com/) is a good way to get familiar with the language and its tools. I think I made it through 17 or so when I was first learning Python. doug. --~--~-~--~

Re: {{ perms }} seems to be empty

2007-05-23 Thread Michael Lake
Jeremy Dunck wrote: > On 5/23/07, Michael Lake <[EMAIL PROTECTED]> wrote: >>I notice it's a Set object comprising a single list. So I thought I could do >>this: >> >>{% for item in perms.lab %} >>{{ item }} >>{% endfor %} > > > Yeah, you can't do attribute access like that for a set. I

Re: {{ perms }} seems to be empty

2007-05-23 Thread Jeremy Dunck
On 5/23/07, Michael Lake <[EMAIL PROTECTED]> wrote: ... > I notice it's a Set object comprising a single list. So I thought I could do > this: > > {% for item in perms.lab %} > {{ item }} > {% endfor %} Yeah, you can't do attribute access like that for a set. It's not the same as a dict

Re: {{ perms }} seems to be empty

2007-05-23 Thread Michael Lake
Jeremy Dunck wrote: > Should be: > > from django.template import RequestContext > ctx = RequestContext(request, data) > return render_to_response('lab/user.html', context_instance=ctx) Ah ha :-) Now it works and I get... perms={% if perms.lab %} yes perms {{ perms.lab }} {% else %}

Re: {{ perms }} seems to be empty

2007-05-23 Thread Jeremy Dunck
Arg! This: > from django.template import RequestContext > ctx = RequestContext(request) > return render_to_response('lab/user.html', context_instance=ctx) Should be: from django.template import RequestContext ctx = RequestContext(request, data) return render_to_response('lab/user.html', contex

Re: {{ perms }} seems to be empty

2007-05-23 Thread Jeremy Dunck
On 5/23/07, Michael Lake <[EMAIL PROTECTED]> wrote: ... > return render_to_response('lab/user.html', data) Yeah, that's your problem right there. You want this: from django.template import RequestContext ctx = RequestContext(request) return render_to_response('lab/user.html', context_insta

Re: {{ perms }} seems to be empty

2007-05-23 Thread Michael Lake
Hi all Martin Hsu suggested to make sure that this is included so I now have this in settings.py TEMPLATE_CONTEXT_PROCESSORS= ("django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n") Still {{ perms }} is empty or at least not displa

Re: Inconsistent SQL generated for ForeignKey fields

2007-05-23 Thread Malcolm Tredinnick
On Wed, 2007-05-23 at 16:29 -0700, Fay wrote: > Hi, > > > I encountered a situation that foreign key constraints were generated > differently for the same data model. > > Below is my test model that has 2 identical sets of 1-to-many tables. > When I run django sqlall command, however the foreig

Re: Best Place To Start Learning Django/Python

2007-05-23 Thread Jeremy Dunck
On 5/23/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > On 5/23/07, Peter Pluta <[EMAIL PROTECTED]> wrote: > > > > > > I don't really have any programming experience outside of hacking up a few > > lines of php,... > Working with someone you know that already knows how to code would be > useful, an

Re: Best Place To Start Learning Django/Python

2007-05-23 Thread Jeremy Dunck
On 5/23/07, Peter Pluta <[EMAIL PROTECTED]> wrote: > > > I don't really have any programming experience outside of hacking up a few > lines of php, but it'd like to start learning python and the django web > framework. I haven't been able to find too many intuitive guides like those > for php, so

Re: Best Place To Start Learning Django/Python

2007-05-23 Thread Tyson Tate
Learning a bit of Python first helps. I'd start with the official Python tutorial: Then give the official Django tutorial a shot: Other than that, there's no better way to get started than by getti

Best Place To Start Learning Django/Python

2007-05-23 Thread Peter Pluta
I don't really have any programming experience outside of hacking up a few lines of php, but it'd like to start learning python and the django web framework. I haven't been able to find too many intuitive guides like those for php, so i'd thought i'd ask here. Does anyone have any good suggestion

Re: Inconsistent SQL generated for ForeignKey fields

2007-05-23 Thread Fay
Forgot to mention, I use MySQL 5.1. On May 23, 4:29 pm, Fay <[EMAIL PROTECTED]> wrote: > Hi, > > I encountered a situation that foreign key constraints were generated > differently for the same data model. > > Below is my test model that has 2 identical sets of 1-to-many tables. > When I run dj

Inconsistent SQL generated for ForeignKey fields

2007-05-23 Thread Fay
Hi, I encountered a situation that foreign key constraints were generated differently for the same data model. Below is my test model that has 2 identical sets of 1-to-many tables. When I run django sqlall command, however the foreign key constraints were built differently, one used column cons

Re: How to delete a session

2007-05-23 Thread urielka
just do this: from django.contrib.sessions.models import Session Session.objects.filter(session_key=request.session.session_key).delete() On May 23, 3:26 pm, Ramashish Baranwal <[EMAIL PROTECTED]> wrote: > Hi, > > How can I delete the session of a request? The docs speak about using > session as

Re: subclassing of models

2007-05-23 Thread Atilla
> Given that there is no branch, that statement is incorrect. > > Model inheritance is two stations down the line. Unicode gets finished > first, then query refactor then model inheritance. > > Regards, > Malcolm Well, I'm certainly glad to know this. I hadn't checked up on it for a long time.

Re: How to define unsigned integer primary keys with auto increment for MySQL

2007-05-23 Thread Malcolm Tredinnick
On Wed, 2007-05-23 at 17:52 +0200, Atilla wrote: > On 23/05/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > On Tue, 2007-05-22 at 06:43 -0700, Fay wrote: > > > I'm using MySQL. The primary key field generated by django uses > > > integer, not unsigned. I'd like to us unsigned integer ins

Re: Displaying data in the admin using list_display

2007-05-23 Thread Malcolm Tredinnick
On Wed, 2007-05-23 at 14:33 -0700, Greg wrote: > I'm having a problem displaying data in my admin using list_display. > I want to be able to show the Manufacturer in the admin from my styles > page. Here are my models: > > class Manufacturer(models.Model): > name = models.CharField(maxleng

Re: newforms: how to report multiple cross-field validation errors?

2007-05-23 Thread Malcolm Tredinnick
On Wed, 2007-05-23 at 10:16 -0700, mario wrote: > I'm using newforms library and it is really a great improvement over > "oldforms". > > However, how would I report more than a single error when doing cross- > field validation in the form clean() method? > > I mean, since the errors are reported

Re: subclassing of models

2007-05-23 Thread Malcolm Tredinnick
On Wed, 2007-05-23 at 17:49 +0200, Atilla wrote: > On 23/05/07, OliverMarchand <[EMAIL PROTECTED]> wrote: > > > > Dear Djangos, > > > > Is it possible to subclass a model? This example somehow doesn't work > > for in the sense that I only see the geography on the admin screen. > > > > > > fro

Re: newforms + testing

2007-05-23 Thread Malcolm Tredinnick
On Wed, 2007-05-23 at 06:01 -0700, [EMAIL PROTECTED] wrote: > Hello, > > I wrote a newforms form, but I have some problems when I want to test > the class. Here's the definition: > > def _users(): > print "calling _users()" > return [(u.id, u.get_full_name()) for u in > User.objects.fil

Displaying data in the admin using list_display

2007-05-23 Thread Greg
I'm having a problem displaying data in my admin using list_display. I want to be able to show the Manufacturer in the admin from my styles page. Here are my models: class Manufacturer(models.Model): name = models.CharField(maxlength=200) manufacturerslug = models.SlugField(prepo

Re: {{ perms }} seems to be empty

2007-05-23 Thread Jeremy Dunck
On 5/23/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > Is "django.core.context_processors.auth" set in your > TEMPLATE_CONTEXT_PROCESSORS? Are those new custom You must also render the template using RequestContext rather than Context in order for TEMPLATE_CONTEXT_PROCESSORS to be run. How

Re: {{ perms }} seems to be empty

2007-05-23 Thread Martin J Hsu
> 1. TEMPLATE_CONTEXT_PROCESSORS is not in my settings file. But the docs say > that its default is: ("django.core.context_processors.auth", etc... > That is correct: http://www.djangoproject.com/documentation/settings/#template-context-processors The default isn't explicitly defined in settin

Re: {{ perms }} seems to be empty

2007-05-23 Thread Martin J Hsu
> 1. TEMPLATE_CONTEXT_PROCESSORS is not in my settings file. But the docs say > that its default is: ("django.core.context_processors.auth", etc... > That is correct: http://www.djangoproject.com/documentation/settings/#template-context-processors The default isn't explicitly defined in settin

Re: {{ perms }} seems to be empty

2007-05-23 Thread Martin J Hsu
> 1. TEMPLATE_CONTEXT_PROCESSORS is not in my settings file. But the docs say > that its default is: ("django.core.context_processors.auth", etc... > That is correct: http://www.djangoproject.com/documentation/settings/#template-context-processors The default isn't explicitly defined in settin

Re: How to delete a session

2007-05-23 Thread Joseph Heck
Ah - right. The middleware returns that all wrapped up. You can use the _session attribute on it to get down to the actual session object (I think - at least based on a quick glance through the code). So (I think) x=request.session._session x.delete() -joe On 5/23/07, Ramashish Baranwal <[EMAI

Re: newforms + testing

2007-05-23 Thread Doug B
If you put the call to your _users() function in the form __init__() I think it will be what you are looking for. initi s called automatically whenever an instance is created. class MemoForm(forms.Form): -snip- def __init__(self,*args,**kwarg) super(MemoForm,self).__init__(*args,**kw

Re: newforms + testing

2007-05-23 Thread Doug B
If you put the call to your _users() function in the form __init__() I think it will be what you are looking for. initi s called automatically whenever an instance is created. class MemoForm(forms.Form): -snip- def __init__(self,*args,**kwarg) super(MemoForm,self).__init__(*args,**kw

Re: newforms + testing

2007-05-23 Thread Doug B
If you put the call to your _users() function in the form __init__() I think it will be what you are looking for. initi s called automatically whenever an instance is created. class MemoForm(forms.Form): -snip- def __init__(self,*args,**kwarg) super(MemoForm,self).__init__(*args,**kw

Re: Where did you put your homepage view?

2007-05-23 Thread Christian Markwart Hoeppner
> I'm juste curious, where did you put your homepage view when you've > got a project with a lot of apps? Is there a best practice here? An extra app? Man... Views do not *have* to reside inside some app. Whenever I have some view not specific to some app, I create a module for those in the proje

Re: NEWBIE: joining two tables problem

2007-05-23 Thread Rogelio
On May 23, 3:10 pm, Rogelio <[EMAIL PROTECTED]> wrote: > Thank you so much! I was able to get your first method to work. The > second method > seemed to be complaining that I was using a for-loop on an empty > "photo_set". > I'll play around it some more. > > Rogelio Sorry for the multiple "th

Re: NEWBIE: joining two tables problem

2007-05-23 Thread Rogelio
Thank you so much! I was able to get your first method to work. The second method seemed to be complaining that I was using a for-loop on an empty "photo_set". I'll play around it some more. Rogelio --~--~-~--~~~---~--~~ You received this message because you ar

Re: NEWBIE: joining two tables problem

2007-05-23 Thread Rogelio
Thank you so much! I was able to get your first method to work. The second method seemed to be complaining that I was using a for-loop on an empty "photo_set". I'll play around it some more. Rogelio --~--~-~--~~~---~--~~ You received this message because you ar

Re: NEWBIE: joining two tables problem

2007-05-23 Thread Rogelio
Thank you so much! I was able to get your first method to work. The second method seemed to be complaining that I was using a for-loop on an empty "photo_set". I'll play around it some more. Rogelio --~--~-~--~~~---~--~~ You received this message because you ar

RESOLVED: Re: Query Question ...

2007-05-23 Thread ZebZiggle
Took some custom SQL, but this works well: content = Content.objects \ .filter(approved__isnull = False) \ .extra(where=['id not in (SELECT content_id FROM relationship WHERE user_id = %d and "hasRead" = TRUE)' % user.id]) \ .order_by('-created') Phew.

Re: need to know to start learn django

2007-05-23 Thread Christian Markwart Hoeppner
El mié, 23-05-2007 a las 11:46 -0500, Tim Chase escribió: > > What i need to know, except python before i start learn django? I went onto my first django-powered project without knowing a bit of python, django, whatever. Actually, I jumped over mid-project! Python is amazingly easy to learn, and

Re: NEWBIE: joining two tables problem

2007-05-23 Thread Tim Chase
> Hello. Newbie to django and first-time poster to this group. welcome! > class Employee(models.Model): > name = models.CharField(maxlength=50) > office = models.CharField(maxlength=20) > phone= models.CharField(maxlength=15) > > class Photo(models.Model): > filename = mo

Re: How to delete a session

2007-05-23 Thread Ramashish Baranwal
> On May 23, 10:18 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > > > The session is a model in Django - so you can delete it like any other - > > > x=request.session > > x.delete() > > > There's also the daily_cleanup.py script included with Django that > > just goes straight to the > > database

Re: How to delete a session

2007-05-23 Thread Ramashish Baranwal
On May 23, 10:18 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > The session is a model in Django - so you can delete it like any other - > > x=request.session > x.delete() > > There's also the daily_cleanup.py script included with Django that > just goes straight to the > database:http://code.dja

Re: How to delete a session

2007-05-23 Thread Ramashish Baranwal
On May 23, 10:18 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > The session is a model in Django - so you can delete it like any other - > > x=request.session > x.delete() > > There's also the daily_cleanup.py script included with Django that > just goes straight to the > database:http://code.dja

Re: How to delete a session

2007-05-23 Thread Ramashish Baranwal
On May 23, 10:18 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > The session is a model in Django - so you can delete it like any other - > > x=request.session > x.delete() > > There's also the daily_cleanup.py script included with Django that > just goes straight to the > database:http://code.dja

NEWBIE: joining two tables problem

2007-05-23 Thread Rogelio
Hello. Newbie to django and first-time poster to this group. I've got two models (basic structure shown below): class Employee(models.Model): name = models.CharField(maxlength=50) office = models.CharField(maxlength=20) phone= models.CharField(maxlength=15) class Photo(models.Mo

user object in templates

2007-05-23 Thread John
it seems like I have no user object in my templates, which is weird, as it comes w/ my request object, and I can access it in my views. In other words, request.user.is_authenticated evaluates to True in my views, but to False in my templates. Before you ask, I do have 'django.core.context_process

GeoDjango Admin interface - Invalid HEX given!

2007-05-23 Thread mikeyparker
I'm just moving an application that we were writing over to the GeoDjango branch and I've come across a small problem that I was hoping that someone may be able to shed a little light on. I have a model class CityArea(models.Model, models.GeoMixin): name = models.CharField(blank=False,

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
Joseph ... you da man! Next time your in Halifax, Nova Scotia ... the beer is on me. I was looking at that method and ignored it since I'm not using transactions. THANK YOU! -Sandy --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET "vote

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET "vote

Re: LIKE '%something%' custom queries

2007-05-23 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > I'm reimplementing an in-database tree system and I'm using custom SQL > queries. I want to use % in LIKE but Django doesn't let me. > > The code: > ## > def getBranch(table_name, parent_depth, parent_cutLevel, max_depth): > cursor = connection.cursor(

Re: Explicit SQL not working ...

2007-05-23 Thread Joseph Heck
When you're done with the command (assuming you're not being explicit about the transactions), use: transaction.commit_unless_managed() to force the commit. -joe On 5/23/07, ZebZiggle <[EMAIL PROTECTED]> wrote: > > More info ... > > I wrote a little program to execute the query directly via p

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET "vote

Re: LIKE '%something%' custom queries

2007-05-23 Thread Atilla
On 23/05/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm reimplementing an in-database tree system and I'm using custom SQL > queries. I want to use % in LIKE but Django doesn't let me. > > The code: > ## > def getBranch(table_name, parent_depth, parent_cutLevel, max_depth): >

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET "vote

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET "vote

Re: LIKE '%something%' custom queries

2007-05-23 Thread Joseph Heck
Don't put the % inside of " characters, or Python will attempt to evaluate it out. Alternately, escape it so it doesn't eval. I generally form up my custom SQL strings outside of the execute() method to make debugging this kind of thing a tad easier. -joe On 5/23/07, [EMAIL PROTECTED] <[EMAIL PR

Re: How to delete a session

2007-05-23 Thread Joseph Heck
The session is a model in Django - so you can delete it like any other - x=request.session x.delete() There's also the daily_cleanup.py script included with Django that just goes straight to the database: http://code.djangoproject.com/browser/django/trunk/django/bin/daily_cleanup.py -joe On 5/

newforms: how to report multiple cross-field validation errors?

2007-05-23 Thread mario
I'm using newforms library and it is really a great improvement over "oldforms". However, how would I report more than a single error when doing cross- field validation in the form clean() method? I mean, since the errors are reported by raising an exception, on the first raised validation error

RE: Displaying my table data

2007-05-23 Thread Chris Brand
> >>> from mysite.rugs.models import Choice, Size, Price > >>> c = Choice.objects.filter(choice=1) > >>> c > [, , ] You can see here that your queryset maps to three objects. > >>> c.size.name > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'QuerySet' object has

LIKE '%something%' custom queries

2007-05-23 Thread [EMAIL PROTECTED]
I'm reimplementing an in-database tree system and I'm using custom SQL queries. I want to use % in LIKE but Django doesn't let me. The code: ## def getBranch(table_name, parent_depth, parent_cutLevel, max_depth): cursor = connection.cursor() cursor.execute("SELECT *, I

Re: How do I Sort Years in Template

2007-05-23 Thread Frank Peterson
thanks, I had to use dictsortreversed and that puts them in newest year first :) --~--~-~--~~~---~--~~ 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.c

Re: need to know to start learn django

2007-05-23 Thread Tim Chase
> What i need to know, except python before i start learn django? *Need* to know? Nothing more than Python and HTML--even that, you might be able to get by with a point-and-drool GUI editor for your HTML editing. However, the more you know about HTML, HTTP, and SQL, the more fewer limitation

need to know to start learn django

2007-05-23 Thread Gigs_
What i need to know, except python before i start learn django? thank you --~--~-~--~~~---~--~~ 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: A Few Questions with How to Work With Views

2007-05-23 Thread Tim Chase
>> (1) I'd like to include little snippets from each app on >> another app's pages. For instance, a little "widget" in a >> sidebar of my blog software that has some random pictures >> from the photo management. Is there any suggestion on how >> to do this? > > Template Tags! > > http://www.dj

Re: Where did you put your homepage view?

2007-05-23 Thread afarnham
> I'm juste curious, where did you put your homepage view when you've > got a project with a lot of apps? I create a django app called "site" and put my index view in there. I also put any template tags and filters that will be used across the project in that app. ~Aaron --~--~-~--~---

Re: How to define unsigned integer primary keys with auto increment for MySQL

2007-05-23 Thread Atilla
On 23/05/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-05-22 at 06:43 -0700, Fay wrote: > > I'm using MySQL. The primary key field generated by django uses > > integer, not unsigned. I'd like to us unsigned integer instead. I can > > explicitly specify PositiveIntegerField wit

Re: subclassing of models

2007-05-23 Thread Atilla
On 23/05/07, OliverMarchand <[EMAIL PROTECTED]> wrote: > > Dear Djangos, > > Is it possible to subclass a model? This example somehow doesn't work > for in the sense that I only see the geography on the admin screen. > > > from django.db import models > > class Geography(models.Model): >

Re: A Few Questions with How to Work With Views

2007-05-23 Thread David Reynolds
On 23 May 2007, at 4:23 pm, rockstar_ wrote: Hi guys- I'm not new to Python, or to web development, but I am new to web development with python and new to Django. I've been reading about Django, and been dabbling with it for about six months. It's about time I crap or get off the pot. An

subclassing of models

2007-05-23 Thread OliverMarchand
Dear Djangos, Is it possible to subclass a model? This example somehow doesn't work for in the sense that I only see the geography on the admin screen. from django.db import models class Geography(models.Model): name = models.CharField(maxlength=30) def __str__(self): retur

Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
I'm doing a very simple direct SQL call cursor = connection.cursor() cursor.execute(sql) which works when I issue the SQL directly in the database, but via django does nothing. cursor.rowcount returns correctly, but there are no rows to fetch and the database isn't updated. Any ideas?

Re: "showable" but not "editable" field in the Admin screens

2007-05-23 Thread Atilla
On 23/05/07, Brian Rosner <[EMAIL PROTECTED]> wrote: > > You may also want to check out http://code.djangoproject.com/ticket/3990. > > On May 22, 5:19 am, "Seiji - technics" <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > Is there a way to show as specific field in the admin screens but > > without

Re: newforms + testing

2007-05-23 Thread [EMAIL PROTECTED]
I fixed my problem, but it's very much a hack. If anyone has a better solution, please post it. My fix was a simple hack: after every instantiation of my MemoForm class, I called a method "replace_recipients" where I changed the value of form_object.base_fields['recipients'].choices. Like I sai

Re: newforms + testing

2007-05-23 Thread [EMAIL PROTECTED]
I fixed my problem, but it's very much a hack. If anyone has a better solution, please post it. My fix was a simple hack: after every instantiation of my MemoForm class, I called a method "replace_recipients" where I changed the value of form_object.base_fields['recipients'].choices. Like I sai

Re: newforms + testing

2007-05-23 Thread [EMAIL PROTECTED]
I fixed my problem, but it's very much a hack. If anyone has a better solution, please post it. My fix was a simple hack: after every instantiation of my MemoForm class, I called a method "replace_recipients" where I changed the value of form_object.base_fields['recipients'].choices. Like I sai

Re: newforms + testing

2007-05-23 Thread [EMAIL PROTECTED]
I fixed my problem, but it's very much a hack. If anyone has a better solution, please post it. My fix was a simple hack: after every instantiation of my MemoForm class, I called a method "replace_recipients" where I changed the value of form_object.base_fields['recipients'].choices. Like I sai

A Few Questions with How to Work With Views

2007-05-23 Thread rockstar_
Hi guys- I'm not new to Python, or to web development, but I am new to web development with python and new to Django. I've been reading about Django, and been dabbling with it for about six months. It's about time I crap or get off the pot. And, well, Django has been fun so far, so I'm gonna

Re: Displaying my table data

2007-05-23 Thread Greg
Carole, I've tried what you suggeted and it still didn't work. I haven't changed my db structure. Here is what I get when I do it in the command prompt >>> from mysite.rugs.models import Choice, Size, Price >>> c = Choice.objects.filter(choice=1) >>> c [, , ] >>> c.size.name Traceback (most rec

Re: Generell Questions on Django

2007-05-23 Thread Julio Nobrega
On 5/23/07, OliverMarchand <[EMAIL PROTECTED]> wrote: > > Hi, > > Now my colleagues first reaction was very defensive: > a) that's for websites, not serious applications My website is a serious application :) And so are, for example, the ljworld.com website where Django was born, or Tabblo,

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Generell Questions on Django

2007-05-23 Thread Jacob Kaplan-Moss
Hi Oliver -- http://en.wikipedia.org/wiki/FUD :) Seriously, though... None of your colleagues' statements display any actual investigation of their claims; they're all almost completely wrong. On 5/23/07, OliverMarchand <[EMAIL PROTECTED]> wrote: > a) that's for websites, not serious applicatio

Re: Generell Questions on Django

2007-05-23 Thread Jarek Zgoda
OliverMarchand napisał(a): > a) that's for websites, not serious applications All web application programming is about websites. > b) it will be slow, ORMs are always slow Indeed. Plain nothing beats plain SQL in terms of data access, but it may be tedious work to actually write these statemen

Re: Generell Questions on Django

2007-05-23 Thread Atilla
On 23/05/07, OliverMarchand <[EMAIL PROTECTED]> wrote: > > Hi, > > I am new to Django (4+years Python experience) and would like to > evaluate for my financial company whether Django may be a good > solution to our problem of designing our applications all a-z from > scratch. Now my colleagues fir

Generell Questions on Django

2007-05-23 Thread OliverMarchand
Hi, I am new to Django (4+years Python experience) and would like to evaluate for my financial company whether Django may be a good solution to our problem of designing our applications all a-z from scratch. Now my colleagues first reaction was very defensive: a) that's for websites, not serious

Re: Where did you put your homepage view?

2007-05-23 Thread Greg Donald
On 5/23/07, David Larlet <[EMAIL PROTECTED]> wrote: > I'm juste curious, where did you put your homepage view when you've > got a project with a lot of apps? Is there a best practice here? I usually make a home controller. Then I typically use an index action for the home page view. -- Greg D

  1   2   >