Re: app/model not showing in admin interface?

2011-03-14 Thread shofty
stop/start the dev server. It doesn't spot new files being created, only changes to existing files. On Mar 13, 8:37 pm, "Mark J. Nenadov" wrote: > Sorry, that code from admin.py should read: > > >> from app.models import Task > >> from django.contrib import admin > >> admin.site.register(Task) >

Re: Multiple modelforms in single POST

2011-03-14 Thread Anoop Thomas Mathew
Hi all, I solved it out.. I got a good tutorial on it, from James Bennett: http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/ @bruno: If this(http://dpaste.de/ODOJ/) was not enough for you, ... @Gladys: Thanks for your time. regards, atm ___ Life is short, Live it hard. On 13 March 20

Re: app/model not showing in admin interface?

2011-03-14 Thread Kenneth Gonsalves
On Mon, 2011-03-14 at 00:14 -0700, shofty wrote: > stop/start the dev server. It doesn't spot new files being created, > only changes to existing files. are you sure? -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message becaus

help to finish my 1st Django app.

2011-03-14 Thread royy
Hi. I've finished the tutorial for the polls app. I tought everythin was OK till I load the server and type the addres: http://127.0.0.1:8000/polls/ web browser shows me the message "No polls are available" isn't a web browser error message, because it is plain text. I've created 3 polls with 3

Re: Chaining stacked inline

2011-03-14 Thread gontran
Hi, back from my WE and still no answers. Should I presume that what I want to do is impossible? On 11 mar, 17:40, gontran wrote: > Hi, > > I'm wondering if it's possible to chain StackedInlined object in a > django admin page. > Let me explain it: > I have a class UserProfile which is linked by

Re: Multiple modelforms in single POST

2011-03-14 Thread bruno desthuilliers
On 14 mar, 08:16, Anoop Thomas Mathew wrote: > > @bruno: If this(http://dpaste.de/ODOJ/) was not enough for you,  ... No, it was not enough. "No success" is just a variant of "doesn't work", which is about the most useless possible description of a problem. http://www.catb.org/~esr/faqs/smart-qu

Re: how to search data from tables

2011-03-14 Thread bruno desthuilliers
On 14 mar, 04:20, django beginner wrote: Main question already answered. As a side note: > Suppose I have this person model: > > class Person(models.Model): >     userid = models.AutoField(primary_key=True) >     fname = models.CharField(max_length=30) >     lname = models.CharField(max_length=3

Re: Multiple modelforms in single POST

2011-03-14 Thread Anoop Thomas Mathew
Thanks buddy. Sure!! I'll try next time. regards, atm ___ Life is short, Live it hard. On 14 March 2011 14:46, bruno desthuilliers wrote: > On 14 mar, 08:16, Anoop Thomas Mathew wrote: > > > > @bruno: If this(http://dpaste.de/ODOJ/) was not enough for you, ... > > No, it was not enough. "No

Re: how to search data from tables

2011-03-14 Thread Gennadiy Zlobin
Yes, because you will have to update age every time on person's birthday and if you forget to do it, you get the invalid data. age = models.DateField() - Gennadiy On Mon, Mar 14, 2011 at 3:19 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > On 14 mar, 04:20, django beginner

Re: file upload size problem

2011-03-14 Thread vamsy krishna
I'm facing a new problem now. I have a defined a custom error page and using the handler413 in my urls file to load this template. However this is not getting picked up. I would like to handle this at django level instead of apache. The ErrorDocument definition in apache works fine. Also the handl

Re: No fixtures found

2011-03-14 Thread Shakthi Kannan
Hi, --- On Fri, Mar 11, 2011 at 6:25 PM, Kenneth Gonsalves wrote: | I tried this out after you brought it up in IRC and made the smallest | possible test. It works for me regardless of what name I give the | fixtures file as long as it is in the fixtures directory of the | application. You must b

Re: how to search data from tables

2011-03-14 Thread Kenneth Gonsalves
On Mon, 2011-03-14 at 15:47 +0600, Gennadiy Zlobin wrote: > Yes, because you will have to update age every time on person's > birthday and > if you forget to do it, you get the invalid data. > > age = models.DateField() date_of_birth = models.DateField() def age(self): return (datetime.datet

Re: Use admin interface in public facing pages?

2011-03-14 Thread Derek
On Mar 11, 12:40 am, gbl wrote: > The admin interface is perfect for the site I'm working on. Automatic > pagination, customizable search fields, filter via boolean or date > fields in a sidebar, clickable sorting on column headings. Easy to > modify > > Is there really no way to use all this

Re: help to finish my 1st Django app.

2011-03-14 Thread Igor Ischenko
Hi Show your template file 2011/3/14 royy > Hi. > > I've finished the tutorial for the polls app. > > I tought everythin was OK till I load the server and type the addres: > http://127.0.0.1:8000/polls/ > > web browser shows me the message "No polls are available" isn't a web > browser error me

Re: template loader is missing a character.

2011-03-14 Thread Tom Evans
On Sun, Mar 13, 2011 at 7:16 AM, royy wrote: > Hi. > > I'm following the tutotial for my first Django app, in part 3 after > edit the views.py file  I'm getting the error. > •Using loader django.template.loaders.filesystem.Loader: >.. > As you can see template loader is missing the letter " t "  o

Re: file upload size problem

2011-03-14 Thread Tom Evans
On Mon, Mar 14, 2011 at 9:02 AM, vamsy krishna wrote: > I'm facing a new problem now. I have a defined a custom error page and > using the handler413 in my urls file to load this template. However > this is not getting picked up. I would like to handle this at django > level instead of apache. The

Re: Can I sort a related model reference in a template?

2011-03-14 Thread Tom Evans
On Sat, Mar 12, 2011 at 1:27 PM, Shawn Milochik wrote: > You can put a sort order in the model's meta info. That way you'll always > have a default sort. > If you do this, every query you execute returning that model will be sorted. This can lead to serious performance issues if sorting is only r

Admin Site Error

2011-03-14 Thread sahana bhat
I am getting this error when i try to activate the admin site... i followed all the steps of the django tutorials. please help... AttributeError at /admin/ 'WSGIRequest' object has no attribute 'user' This is the stack trace.. Traceback (most recent call last): File "C:\Python26\lib\site-p

Why is the first Manager defined in a model the default?

2011-03-14 Thread gamingdroid
I'm a little confused about Manager classes and how they function: 1. Why is the first custom Manager class defined in a model, the default? It would seem more reasonable to have the default manager field, re-assigned as opposed to figuring it out by order of definition declaration. 2. Suppose I

Difference between RequestContext and Context?

2011-03-14 Thread gamingdroid
1. So beyond the fact that RequestContext can accept a dictionary with values to be included in the Context, what is the difference between RequestContext and Context? I tried reviewing the source code, but it still isn't really clear (i.e. meaning I didn't quite understand the source code). 2. W

Looking for Django developers in Sydney!

2011-03-14 Thread Zac Altman
Hey, I am looking for one (or two) great Django developers who live in Sydney, Australia. I have two opportunities for you. The first is to join a social restaurant discovery startup. It is a great project with immense (and tasty) rewards. The second is a 2 month paid contact to build the backend

Help using internationalization feature

2011-03-14 Thread aldanajaramillo
Hi, I am new with Python and Django. Currently I am working on a new project using Django and I already have some templates ready to be used but now I want to use the internationalization feature to translate some texts of these templates. I already read the documentation about it but I don't know

Re: Difference between RequestContext and Context?

2011-03-14 Thread Tom Evans
On Mon, Mar 14, 2011 at 8:16 AM, gamingdroid wrote: > 1. So beyond the fact that RequestContext can accept a dictionary with > values to be included in the Context, what is the difference between > RequestContext and Context? > > I tried reviewing the source code, but it still isn't really clear >

Re: Admin Site Error

2011-03-14 Thread Tom Evans
On Mon, Mar 14, 2011 at 5:21 AM, sahana bhat wrote: > I am getting this error when i try to activate the admin site... i > followed all the steps of the django tutorials. please help... > > AttributeError at /admin/ > 'WSGIRequest' object has no attribute 'user' > > This is the stack trace.. >

Re: Help using internationalization feature

2011-03-14 Thread hassan
take a look at http://docs.djangoproject.com/en/1.2/topics/i18n/internationalization/ it is clear, but for short: 1 - in .py files: from django.utils.translation import ugettext as _ and mark each text you want to traslate like this _("My string") 2 - in .html files: {% load i18n %}

Re: how to search data from tables

2011-03-14 Thread scarab
Read some Django documentation about querysets, filters etc. There are answers there ;) Try this: result = Person.objects.filter(nationality="American", age=17) On 14 Mar, 04:20, django beginner wrote: > Hi all, > > I would like to know is there any way I can search any data from > tables given s

Re: django-registration - Activate view not works

2011-03-14 Thread Cromulent
Sounds to me like you have done the wrong thing in your templates. My registration email template contains this line: http://{{ site }}{% url registration_activate activation_key=activation_key %} which should provide the correct information. If you already have that and it still does not work

Re: Help using internationalization feature

2011-03-14 Thread Tom Evans
On Mon, Mar 14, 2011 at 1:27 PM, hassan wrote: > take a look at > http://docs.djangoproject.com/en/1.2/topics/i18n/internationalization/ > it is clear, > but for short: > > 1 - in .py files: >    from django.utils.translation import ugettext as _ >    and mark each text you want to traslate like

Re: app/model not showing in admin interface?

2011-03-14 Thread shofty
100% documented here. http://docs.djangoproject.com/en/dev/intro/tutorial02/#make-the-poll-app-modifiable-in-the-admin easy enough to test, new app, new admin.py, refresh the admin, not there. stop/start, it;ll be there. caught me out more than once til i properly read the tut. Matt On Mar 14

request in model

2011-03-14 Thread Igor Nemilentsev
I am new in Django. I am looking for a solution for my problem. I want to have a base model class inheriting all other model classes from that class. In the base model class I want to check some permissions for users. So, need pass request to model class so that to have request.user.

Re: Difference between RequestContext and Context?

2011-03-14 Thread gamingdroid
I see, so I completely misunderstood RequestContext. There is only two differences, RequestContext takes a HttpRequest object as it's first argument and automatically includes TEMPLATE_CONTEXT_PROCESSOR dictionaries into the context. Question then is why using RequestContext forced me to include

Re: Is it safe to change the "id" field of a model from int to bigint in the DB schema?

2011-03-14 Thread Bill Freeman
You ill have to start by asking about your specific database, preferably from someone who knows that database definitively. The id field is generally set up to be automatically populated using a database sequence object, so one question is whether your database's sequences can be bigint. Another

Django projects, apps, and git repos

2011-03-14 Thread br
I have a question about how people relate django projects & apps (including django apps that are shared between projects) to git repositories. We are using a gitolite setup on a central server to share repositories between developers. Right now we have two different projects, each with a correspo

Re: Help using internationalization feature

2011-03-14 Thread Tom Evans
On Mon, Mar 14, 2011 at 4:05 PM, Juan Gabriel Aldana Jaramillo wrote: > Thanks for your response. > Now, If I have a text that will be translated ( {% trans "text_1" %}), Where > should I call the _("text_1") view to store the label and its translation? > According to the documentation, this view

Re: Help using internationalization feature

2011-03-14 Thread Juan Gabriel Aldana Jaramillo
Thanks for your response. Now, If I have a text that will be translated ( {% trans "text_1" %}), Where should I call the _("text_1") view to store the label and its translation? According to the documentation, this view could be called inside the .py file but I think that doing that I am breaking

Re: Django projects, apps, and git repos

2011-03-14 Thread Mike Ramirez
On Monday, March 14, 2011 08:22:23 am br wrote: > Just curious if there is a best way to manage this both from a project- > management and a git perspective. > > Thanks > > br Before I begin, 'best' is completely subjective and I think all this comes down to what works for you and the situation

Re: Help using internationalization feature

2011-03-14 Thread Juan Gabriel Aldana Jaramillo
Thanks for your comprehensive reply. Now everything is clear to me. On Mon, Mar 14, 2011 at 11:30 AM, Tom Evans wrote: > On Mon, Mar 14, 2011 at 4:05 PM, Juan Gabriel Aldana Jaramillo > wrote: > > Thanks for your response. > > Now, If I have a text that will be translated ( {% trans "text_1" %

Re: request in model

2011-03-14 Thread Mike Ramirez
On Monday, March 14, 2011 07:45:23 am Igor Nemilentsev wrote: > I am new in Django. > I am looking for a solution for my problem. > I want to have a base model class > inheriting all other model classes from that class. > In the base model class I want to check > some permissions for users. > So, n

Re: Why is the first Manager defined in a model the default?

2011-03-14 Thread Shawn Milochik
I can't address the first question because it was probably discussed among the developers and was a design decision. As for the second, you don't *have to* create an 'objects' manager at all. If you do nothing, you get a Manager() for free by default, and because it has to be named *something*, it

Re: Looking for Django developers in Sydney!

2011-03-14 Thread bixly.com
Hi Zac Altman, I was searching through job postings for Django, looking for companies such as yourself who could use our help. I found your listing and wanted to let you know, I'm the Senior Consultant for a Django company called Bixly. I know your posting was looking for an on-site developer howe

Re: Is it safe to change the "id" field of a model from int to bigint in the DB schema?

2011-03-14 Thread David De La Harpe Golden
On 13/03/11 05:02, Andy wrote: > I have a model that may have a lot (billions) of records. I understand > that the "id" field of a model is defined as a 32-bits int. So it may > not be big enough. > > Is it safe to just ALTER the database schema to change the "id" field > from int to bigint? Would

Re: Django projects, apps, and git repos

2011-03-14 Thread Shawn Milochik
Think of your pluggable Django apps like they were any other Python module, such as your database driver, Django itself, South, Celery, or whatever. The easiest and cleanest way to do it is to package your pluggable apps so you can install them with pip or setuptools. If there's an update, upgrade

How make CSRF middleware emit html4 rather than xhtml1.0 (closing tags issue) so will validate?

2011-03-14 Thread Chris Seberino
My Django app's html won't validate because CSRF middleware adds hidden tags like this... The only problem is the slash "/>" at the end. How make Django templates not automatically add hidden tags that won't validate? Thanks! cs -- You received this message because you are subscribed to the

Documentation error?

2011-03-14 Thread Adam Knight
On the description for django.contrib.auth.views.login at http://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.auth.views.loginthe documentation says: If you are using alternate authentication (see Other authentication sources) > you can pass a custom authentication form to the login v

Explicitly telling django that the reverse OneToOne relationship doesn't exist

2011-03-14 Thread Viktor Kojouharov
Hello, I have a database function that returns the necessary data for constructing a bunch of related objects in one go. One of the objects has a OneToOne relationship with my main model instance, and it doesn't exists for every object of the main model. Since the main model has a reverse relat

RE: Need experts to develop for you? Try Bixly

2011-03-14 Thread Cal Leeming
In regards to your original post, one thing I'd certainly like to see from this, is some example code from your developers. It doesn't need to be anything conclusive, just random snippets of code you guys have written. For a company to say they "specialise" in Django development, but to not have an

better options for hosting multiple django based websites?

2011-03-14 Thread garagefan
I've got a server hosting multiple websites. Currently its not a big deal to add another virtual host entry to apache2. Now, i'm using a bad habit and using an http.conf instead of learning about, and setting up "available sites". I'm using mod_wsgi as well. Now, in consideration of using "availa

Re: How do I run test and get results programmatically? (django, south, fixtures, sqlite)

2011-03-14 Thread Jumpfroggy
@gladys, While that didn't solve my original question, it did solve another related problem. Before, I had issue with migrations failing since they depended on pre-existing data (which did not exist in the blank testing database). But if I added an initial_data.json fixture, it gets run for ever

Re: better options for hosting multiple django based websites?

2011-03-14 Thread Graham Dumpleton
On Monday, March 14, 2011 4:27:19 PM UTC-4, garagefan wrote: > > I've got a server hosting multiple websites. Currently its not a big > deal to add another virtual host entry to apache2. Now, i'm using a > bad habit and using an http.conf instead of learning about, and > setting up "available

How to use extra to count based on the value of a field?

2011-03-14 Thread Margie Roginski
class Queue(models.Model): # fields here, not relevant for this discussion class Task(models.Mode): queue = models.ForeignKey("Queue") status = models.IntegerField(choices=STATUS_CHOICES) I am trying to create a Queue queryset that will annotate each Queue with the number of tasks whose que

Re: django-registration - Activate view not works

2011-03-14 Thread Sergio Berlotto Jr
I´ll try it.. In my template I wrote the URL manually ! Oh god.. heheh -- 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, send email to django-use

Re: Why is the first Manager defined in a model the default?

2011-03-14 Thread gamingdroid
Hi Shawn, Thank you for your response. So is it correct then that if I assign a Manager object in my model, there will be no default Manager in model.object field? My book, The Definite Guide to Django, seem to suggest so, but it doesn't make sense. It essentially means you are breaking the abil

Re: Why is the first Manager defined in a model the default?

2011-03-14 Thread Shawn Milochik
I also have a copy of that book, and I believe that what you're referring to pages 197 and 198. Here is what the authors are doing there: 1. Creating a special manager that does one thing -- return a filtered subset of the model instances. 2. Creating a replacement 'objects' manager sinc

Re: better options for hosting multiple django based websites?

2011-03-14 Thread garagefan
i meant ScriptAlias :( how embarrassing. And no... it does not appear that i am using it in daemon mode as the only reference of wsgi in my http.conf file are those WSGIScriptAlias' within virtualhost's On Mar 14, 4:46 pm, Graham Dumpleton wrote: > On Monday, March 14, 2011 4:27:19 PM UTC-4, gar

Re: Why is the first Manager defined in a model the default?

2011-03-14 Thread gamingdroid
I guess what is the point of having a default manager? So if the default manager isn't named objects, then how does the code know where the default lives? Without the default (non-custom) manager, how is the code able to support commonly used operations such as model.objects.filter(...)? Basical

Re: help to finish my 1st Django app.

2011-03-14 Thread Rogelio Gonzalez
Hi Igor. Thanks for your reply. My poll_list.html code is: {% if latest_poll_list %} {% for poll in latest_poll_list %} {{ poll.question }} {% endfor %} {% else %} No polls are available. {% endif %} What i'm doing wrong?.. 2011/3/14 royy > Hi. > > I've finished t

Re: Why is the first Manager defined in a model the default?

2011-03-14 Thread gamingdroid
I guess what is the point of having a default manager? So if the default manager isn't named objects, then how does the code know where the default lives? Without the default (non-custom) manager, how is the code able to support commonly used operations such as model.objects.filter(...)? Basical

Re: Why is the first Manager defined in a model the default?

2011-03-14 Thread James Bennett
On Mon, Mar 14, 2011 at 6:14 PM, gamingdroid wrote: > So if the default manager isn't named objects, then how does the code > know where the default lives? There's internal API for asking a model class what its default manager is, and Django makes use of it. Most things you'd want to find out abo

Re: help to finish my 1st Django app.

2011-03-14 Thread christian.posta
Your template file checks to see whether a variable named "latest_poll_list" exists. I don't see anywhere in your views where you add this to your context. Look at part 3 of the tutorial about half way down. They add the "latest_poll_list" object to the Context that gets passed to your template. Tr

Tests with test specific models

2011-03-14 Thread Mike Ramirez
Example: I have an app that uses ContentType and I want to test that against an arbitrary model to make sure that the usage of ContentType is correct. Ex: In my app.models I have: class Rating(models.Model): total = models.DecimalField(default=0, decimal_places=2, max_digits=8) score =

Re: How make CSRF middleware emit html4 rather than xhtml1.0 (closing tags issue) so will validate?

2011-03-14 Thread Ian Clelland
On Mon, Mar 14, 2011 at 10:57 AM, Chris Seberino wrote: > My Django app's html won't validate because CSRF middleware adds > hidden > tags like this... > > name='csrfmiddlewaretoken' value='ebcf3d41f32a70a209e27ef7fdf06d72' /> > > The only problem is the slash "/>" at the end. > > How make Django

Re: file upload size problem

2011-03-14 Thread vamsy krishna
Thanks Tom. I also looked up the Django code and realised there is no handler413 defined. I'm now doing it in apache the way you mentioned. On Mar 14, 4:38 pm, Tom Evans wrote: > On Mon, Mar 14, 2011 at 9:02 AM, vamsy krishna wrote: > > I'm facing a new problem now. I have a defined a custom err

Re: Why is the first Manager defined in a model the default?

2011-03-14 Thread gamingdroid
Hi James, Thanks for answering my questions, but your example of re-assigning model.objects doesn't jive well with me. How is the current implementation of having (to me) obfuscated way of determining what the default manager is? If you stupendously re-assign model.objects, then sure you will brea

Django does not fetch page from memcached.

2011-03-14 Thread muzhig
Hello! I'm trying to achieve cache site. Launched memcached, made the necessary adjustments: CACHE_BACKEND = 'memcached://unix:/home/username/memcached.sock' CACHE_MIDDLEWARE_SECONDS = 600 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True added two middleware entries as it stated in the documentation MIDDLE

Re: Error on aggragate function-Count

2011-03-14 Thread pols
Thanks for correcting me...Its now working -- 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, send email to django-users+unsubscr...@googlegroups.