blank vs. exclude

2008-09-28 Thread johnny
I have a question about the exclude property in ModelForm. When I have a Model and the ModelForm for it excludes a field from that Model, shouldn't the ModelForm validation excludes that field as well? It seems the only way to exclude the field from validation is to make it blank=True in the Mod

Re: blank vs. exclude

2008-09-29 Thread johnny
correct code (assuming modelform is used): > > class OrderForm(ModelForm): >     class Meta: >         model = Order >         exclude = ['number', 'state', 'state_since'] > > nb: The excluded fields have no null/blank/editable options set in the mo

Ticket #5737: "CheckboxSelectMultiple when you use choices, required=False is not respected" reappearing?

2008-10-02 Thread johnny
I found the same problem as ticket #5737. It was closed due to unable to reproduce it, but I am seeing the same problem. I have: class QueryForm(f.Form): status = f.ChoiceField(choices=STATUS_TYPES, widget=f.CheckboxSelectMultiple(), required=False) and the form validation errored: statu

select_related()

2008-10-05 Thread johnny
Hi, I'm wondering if select_related() is used for the object_detail generic view. If not, shouldn't it be since it's more efficient? Also, is select_related only useful on a .get() method? thanks. Johnny --~--~-~--~~~---~--~~ You received this

Re: select_related()

2008-10-05 Thread johnny
Ok, for example, I can pass in Modelname.objects.select_related().all() for the queryset, obj's_Id for the object_id. And the 'object' in the generic view will actually be calling a .get(id=obj's_Id) on that lazy, select_related queryset? thanks for the reply, Johnny On Oct

Using Javascript

2008-10-08 Thread Johnny
Hi everyone, I'm writting a Web App using Django and I got problems to make appear or deasappear some content. Here is the code I was using to write a part of the windows: Episode Name

Nice representation for Querying with ForeignKeys

2008-08-27 Thread johnny
) the objective is to serialize it (if it makes a difference), but the key idea is to have the output fields represented as if B were never a separate model. thank you so much, Johnny --~--~-~--~~~---~--~~ You received this message because you are subscribe

Nice representation for Querying with ForeignKeys

2008-08-27 Thread johnny
ues() the objective is to serialize it (if it makes a difference), but the key idea is to have the output fields represented as if B were never a separate model. thank you so much, Johnny --~--~-~--~~~---~--~~ You received this message because you are subscribe

Form info about records numbering not updated and not working

2010-07-22 Thread Johnny
; button I can navigate on "newly" mySQL added record . So they exist but I can see the form record info corectly. Is there a table that control this kind of updating ? What can be the solution for that problem ? Is it possible to understand wich is the program used there ? Many thanks for eac

Re: Django 1.3 CSRF faild when upgraded from Django 1.2.5

2011-05-10 Thread _ johnny .
Try add RequestContext in render_to_response() from django.template import RequestContext return render_to_response('account/login.html', > locals(), context_instance=RequestContext(request)) On Tue, May 10, 2011 at 10:10 AM, 阮明辉 wrote: > return render_to_response('account/login.html') > --

Q Objects: Can you do this?

2007-06-18 Thread johnny
Can you do this? citylist = CityList.objects.get( Q(city="%s" % (line[3])), Q(state=slist.id) ) I am getting the following error: citylist = CityList.objects.g

RENDER_TO_RESPONSE and PRETTY ROUTING URL

2007-06-19 Thread johnny
When I use render_to_response, can I have routing url in it like '/ posts/all/' or I have to have '/posts/all.html''? My small code: # I am passing list of objects called 'posts' to template return render_to_response('/posts/all/', {'posts': posts}) In my browser, I want to have pretty url like

newb: Model DateTimeField and Timedelta

2007-07-03 Thread johnny
My model named: Post It has a field created_at as: created_at = models.DateTimeField(auto_now_add = True) Would Post.created_at be of string or datetime ? I want to add 2 weeks to it, like Post.created_at + 14 days. Can I do this? Post.created_at =Post.created_at + datetime.timedelta(weeks=2)

Anyone running Django and MySQL Cluster

2007-07-06 Thread johnny
Is it even possible to run Django and MySQL Cluster or I have to write some patch to django for it to work (I am not a python or Django guru.)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Query Object and comparing only partial TimeField Value

2007-07-08 Thread johnny
What I want to do is get post between 9:00AM-5:00PM on any day. I just want to compare Hour part of "created_at" field. If the hour is between 9-5, can be any day, get the matching records. Pseudo Django Python Code: Post.objects.get( Q(created_at = (9:00AM - 5:00PM))) Is this possible? --~

from settings import *, non-django python script Error

2007-07-24 Thread johnny
import re from BeautifulSoup import BeautifulSoup import urllib2 from os import environ #from settings import * def myfunction() : environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings" from settings import * I get an error: myscript.py:22: SyntaxWarning: import * only allowed at module

Objects.filter only on minutes range

2007-09-09 Thread johnny
If I use a filter, how do retrieve pub_date falls between certain minutes (0 <= pub_date_minutes < 20 minutes, 20minutes <= pub_date_minutes < 40 minutes, so on) I looked at an example on django site: Entry.objects.filter( headline__startswith='What').exclude( pub_date__gte=datetime

Custom_SQL_Method in a Model

2007-09-09 Thread johnny
I need to define custom sql for a model, so it is only accessible by model class but not by model instances. Where do I define is my_custom_sql, like below, inside the Person class (my guess is not, if need to access my_custom_sql, then I need to instantiate Person.): class Person(models.Model):

Re: Custom_SQL_Method in a Model

2007-09-09 Thread johnny
you create class called PersonManager(models.Manager) and define my_custom_sql inside there. Do you place this class in the same models.py or in a separate file called apps/people/manager.py and then import it where ever you need it? What is the best practice? --~--~-~--~~-

Linux django_settings_module problem

2007-09-10 Thread johnny
Trying to run standalone python script that uses django orm. Something wrong with path setup to execute this python script. Also, what is the purpose of setting $DJANGO_SETTINGS_MODULE=mysite.settings? I think this is where the problem is. /home/bobby/dev/workspace has folder: mysite, django_sr

Re: Linux django_settings_module problem

2007-09-11 Thread johnny
Only works when I put my actual project folder (/home/bobby/dev/ workspace/mysite) into to the $PYTHONPATH and $PATH. All my django code, I never do: from mysite.apps.whatever import just: from apps.whatever import So in this case, I guess you have to put in the project folder into the $PYTHO

django database access with threadpool

2007-09-11 Thread johnny
I am implementing a backend python script that updates the database. It uses threadpool(http://snippets.dzone.com/posts/show/4425#related). Threadpool size is 3. When records are returned, eg. 10 records, 3 threads are created, then the threads update the database, but doesn't seem to do task_don

Re: django database access with threadpool

2007-09-11 Thread johnny
I can someone tell me how the database connection is handled for threads. Do I have to pass conneciton object to each threads? All I am doing is this: @threadpool(pool) def process(i): print 'threadpool %i enter' % i p = Profile.objects.get(id=i) p.status ="sent" p.save()

"online/offline status" on user profile

2007-09-16 Thread johnny
What I want to do is display "online/offline status" on user profile? anybody have an idea how to get information about user is logged in(active session) or not? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

fixtures: yaml, manage.py syncdb error when no data in initial_data.yml

2007-09-19 Thread johnny
class Category(models.Model): id = models.AutoField(primary_key=True) parent_id = models.IntegerField() name = models.CharField(maxlength=200) Problem installing fixture 'c:\mysite\apps\category\fixtures \initial_data.yaml': 'NoneType' object has no attribute 'anchor' What is the iss

fixtures: Invalid model identifier

2007-09-19 Thread johnny
from django.db import models from django.contrib.auth.models import User class Category(models.Model): id = models.AutoField(primary_key=True) parent_id = models.IntegerField() name = models.CharField(maxlength=200) Problem installing fixture 'c:\mysite\apps\category\fixtures \initi

Re: fixtures: yaml, manage.py syncdb error when no data in initial_data.yml

2007-09-19 Thread johnny
this error is due to auto incremented primary key. you can't have empty fixture file. --~--~-~--~~~---~--~~ 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@googlegr

Re: fixtures: Invalid model identifier

2007-09-19 Thread johnny
FIX: "model": "category.Category", NOT this: "model": "apps.category.models.Category", --~--~-~--~~~---~--~~ 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@goog

Re: fixtures (yaml)

2007-09-28 Thread johnny
Does this command dump the whole app models or can you specify a specific model? ./manage.py dumpdata --format=yaml yourAppNameHere, command seems to print on the screen. How do you specify to dump it to a file? --~--~-~--~~~---~--~~ You received this message b

template base.html block-template-tag above

2007-10-09 Thread johnny
In django template, can you have (% block somename %} above root html element of a document, like here? my base.html http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";> {% block html %} http://www.w3.org/1999/xhtml";> {% endblock %} --~--~-~--~~~---~--~~ You re

pagination documentation unclear

2007-10-11 Thread johnny
I was going over documentation on pagination and it mentions you can do it in two ways as follows: URL... ?page=x or (r'^objects/page(?P[0-9]+)/$', 'object_list', dict(info_dict)) My question is, you would use "URL... ?page=x" for regular views? "(r'^objects/page(?P[0-9]+)/$', 'object_list', d

django debugging eclipse watch variable problem

2007-10-12 Thread johnny
I am trying to watch a variable in my app. Setup is fine. I can run manage.py runserver inside eclipse and view debug window and place break points. But can't seem to watch the variable values. I am getting following error: could not resolve variable Here is the pic: http://farm3.static.flic

Re: django debugging eclipse watch variable problem

2007-10-13 Thread johnny
> Preferences... Pydev > Interpreter - Python System PYTHONPATH > New Folder Folder : c:\django\mysite using eclipse with watch variable would make life easier ;) On Oct 12, 11:04 am, johnny <[EMAIL PROTECTED]> wrote: > I am trying to watch a variable in my app. Setup i

python code in template

2007-10-15 Thread johnny
Is there a way to run python code in the template? In view, I just fetchall from database and pass it to the template But I found out I need to break up the content in one of the field. As each records are looped inside the template, I need to break up a field and display it. --~--~-~

newform: Why Doesn't This work

2007-10-16 Thread johnny
Below is my form class. Inside myForm, I tried doing this: choice = forms.ChoiceField(label="My choice", choices=myChoice(self.q_prime).choices()) I get an error right here "choices=myChoice(self.q_prime).choices()": name 'self' is not defined My Form Class: class myCh

template and array like template variable access

2007-10-17 Thread johnny
{% for a_tup in rs %} {{ a_tup[0] }}/ {{ a_tup[1] {% endfor %} Exception Type: TemplateSyntaxError Exception Value:Could not parse the remainder: '[0]' from 'a_tup[0]' Only way to do this is to have nested for loop inside template? --

two block template tags on after another

2007-10-18 Thread johnny
I have templatetags/custom_format.py, and in it I have do_custom_format_string1, do_custom_format_string2. I placed the template tags one after another, insdie my html page like this: {% for a_object in object_list %} {% load custom_format %} {% custom_format_string1 a_object.3 %} {{split_strin

Re: two block template tags on after another

2007-10-19 Thread johnny
I am looking at this documentation: http://www.djangoproject.com/documentation/templates_python/#parsing-until-another-block-tag-and-saving-contents It has the following code: output = self.nodelist.render(context) return output.upper() upper() in output.upper(), I am assuming is the nam

Re: two block template tags on after another

2007-10-19 Thread johnny
What I need to do is, get the records from the database and split fields contents. One of the field, has commas separated contents and another field has - separated fields. In my view, I just do fetchall of database records and send to view. From the view, I do a for loop to go through each rec

Re: two block template tags on after another

2007-10-19 Thread johnny
Can someone help me, plz? I have two block tags that take an argument and then sets a variable in the template. The two block tags are inside the template "for loop" tags, one after another. On Oct 18, 3:00 pm, johnny <[EMAIL PROTECTED]> wrote: > I have templatetags/custo

Re: two block template tags on after another

2007-10-19 Thread johnny
There is a problem with default django for loop tag {% for %} {% endfor%} . Django template doesn't seem to like nested block tag inside for loop tag. {% for a_object in object_list %} {% load custom_format %} {% custom_format_string1 a_object.3 %} {{split_string_data1}} {% end_custom_format_st

Re: two block template tags on after another

2007-10-21 Thread johnny
Thank you, Karen and Marty for the help. It made lot of difference. john --~--~-~--~~~---~--~~ 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

Form Field Question from python noob

2007-11-14 Thread johnny
I have seen forms without the "self" in front of the fields, eg. more like this date_from = forms.DateField() and never self.date_form =forms.DateField(). If you include self.date_form, then date_form becomes an attribute of an instance rather than a attribute of a class. What confusing me is th

Django i18n How

2006-12-28 Thread johnny
Can someone tell how Django does i18n. I am thinking of doing my next project using Django. UI is template tagged, based i18n and i18n dependent database content? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: Django i18n How

2007-01-10 Thread johnny
I have read the django book at djangobook.com. What I wanted to know now is, how the database content related to the i18n handled. Do I have to create a separate tables for each language. I have looked at symfony-project.com i18n http://www.symfony-project.com/book/trunk/i18n, a php framework,

Validation on Client Side? Django support only server side validation

2007-01-16 Thread johnny
Django support only server side validation. Dose it support validation on Client Side? I would like to push it on client, to keep my server load light. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

How to Upgrade Django from 0.95 to Current Dev

2007-01-18 Thread johnny
I have right now 0.95, I would like to upgrade to current dev source. Is there a command I can issue to upgrade? If not what do I need to do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Django Book Add Google or Yahoo Site Search

2007-01-21 Thread johnny
Is it possible to add Google or Yahoo Site Search to Djangobook.com? 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.

How to set "REMEMBER ME"

2007-01-21 Thread johnny
How do I set "remember me" in Django, so that user doesn't have to log in every time. Is there a good tutorial or sample code some where? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

syncdb: No module named Utils

2007-01-21 Thread johnny
what does it mean "No module named Utils" when I run python manage.py syncdb? I have looked into INSTALLED_APPS, there is nothing called "Utils" Someone mentioned CONTEXT_PROCESSORS, I don't have it in settings.py Anyone have any idea? --~--~-~--~~~---~--~~ You

Does django create apps folder for you?

2007-01-21 Thread johnny
Does django create apps folder for you, so you can create weblogs, forums inside it? I tried using python manage.py startapp polls, but it doesn't create apps folder. It creates polls in the current folder "mysite/polls", not "mysite/apps/polls". How do I get an apps folder to contain forums, ne

Re: syncdb: No module named Utils

2007-01-21 Thread johnny
I am using ActiveState Python 2.4 --~--~-~--~~~---~--~~ 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 t

Re: syncdb: No module named Utils

2007-01-21 Thread johnny
Does it have to do with : python setup.py install I did earlier for Django 0.95 (using python egg). I deleted the files, and checked out the django dev verion. >From IBM site: http://www-128.ibm.com/developerworks/library/l-cppeak3.html setuptools framework, a side project of the Python Enterpr

Simple Model Question

2007-01-22 Thread johnny
If I have the following: model1 import modelTemp class exe (class exe uses a foreignKey from modelTemp) model2 import model1.exe class exe1 (class exe1 uses a foreignKey from exe) Question I have is, do I have to import modelTemp for model2 also? --~--~-~--~~~---~-

No module named MIMEText

2007-01-22 Thread johnny
when I run python manage.py runserver and go to http://127.0.0.1:8000/admin/ I get an error: ImproperlyConfigured: Error importing middleware django.middleware.common: "No module named MIMEText" Traceback (most recent call last): File "H:\xampp\python\lib\site-packages\django\core\servers\bas

Re: No module named MIMEText

2007-01-26 Thread johnny
n > Python24\Lib\email\ helped. > > -Original Message- > From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] > > On Behalf Of johnny > Sent: Monday, January 22, 2007 9:25 PM > To: Django users > Subject: No module named MIMEText > > when I run python manag

TinyMCE in Admin and Template page product_form.html

2007-01-28 Thread johnny
Trying to get TinyMCE to work on Admin area of the model and flat template pages. This what I have so far. But I am not getting the TinyMCE textarea for admin or for template field form.description in product_form.html. Thank You in advance. Django TinyMCE setup in admin model class Product

Django Template DropDown List

2007-01-28 Thread johnny
I want the category to show up in drop down list, in product app with product_form.html template. In my product_form.html, I have the following: Category: {{ form.category }} {% if form.category.errors %}*** {{ form.category.errors|join:", " }}{% endif %} In my model for product, I sp

Re: Django Template DropDown List

2007-01-28 Thread johnny
I solved it. Problem was this: category_id = models.ForeignKey(Category) which creates category_id_id in mysql table. In the model, remove _id and it should of been: category = models.ForeignKey(Category) Thank you. On Jan 28, 2:04 pm, "johnny" <[EMAIL PROTECTED]> wro

Template Not Displaying INPUT FIELD

2007-01-28 Thread johnny
In my template, I am not getting a input field for start_at. In my MySQL, I have the following: --+---+--+-+- ++ Field| Type | Null | Key | Default | Extra | --+---+--+

Re: Template Not Displaying INPUT FIELD

2007-01-29 Thread johnny
form field. > > On Jan 28, 3:16 pm, "johnny" <[EMAIL PROTECTED]> wrote: > > > In my template, I am not getting a input field for start_at. In my > > MySQL, > > I have the following: > > --+---+--+-+- > &

Any open source project using Django and Twisted Together

2007-01-30 Thread johnny
Is there are any open source project using Django and Twisted together? I need a sample project to take a look. Thank You. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Simple Regex In Django routing:

2007-01-30 Thread johnny
What does [-\w]+ and [_\w]+ in the following: (?P[-\w]+) (?P[_\w]+) --~--~-~--~~~---~--~~ 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 unsubs

create_object(follow) what is parameter follow?

2007-02-04 Thread johnny
Can someone tell me what is follow=None in create_object is for? I searched for it in docs, nothing came out. def create_object(request, model, template_name=None, template_loader=loader, extra_context=None, post_save_redirect=None, login_required=False, follow=None, context_proc

Using NEWFORMS to select data from the MODEL

2007-02-10 Thread johnny
I have to include some fields from 3 different models. How do you create a selection field, for selecting a category data, in category model, using newforms? Thank You in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

newforms Validation Static vs Dynamic

2007-02-10 Thread johnny
What is the different between newforms, forms.CharField(max_length = 30, min_length = 5, error_message ='Must be at least 5 char length') and using clean method raise forms.ValidationError ('Display some error message') Is former for static error message and later for Dynamic Error Message? --~

Re: Clone DjangoBook.com -- Open book platform beta release

2007-02-11 Thread johnny
What version of Django does it support, dev or 0.95? I was looking for some example in Django and jQuery. Thank You. John On Feb 11, 10:39 am, limodou <[EMAIL PROTECTED]> wrote: > Recently I made a clone project similar djangobook.com, but I add some > extra management features, for example: >

Newforms: Can I do these?

2007-02-11 Thread johnny
Can I create the following in newforms: forms.DateTimeField forms.IntegerField forms.FloatField forms.TextField forms.LargeTextField --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Newforms: Can I do these?

2007-02-11 Thread johnny
One last thing forgot to ask: What about forms.ImageField? --~--~-~--~~~---~--~~ 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

newb question: Kind of confused MEDIA_URL, MEDIA_ROOT, SITE_MEDIA and so on.

2007-02-11 Thread johnny
Do you keep your frontend related css,js file in separate folder other than admin (My assumption is admin, is the BACKEND)? I am confused with: ADMIN_MEDIA_PREFIX SITE_MEDIA MEDIA_ROOT MEDIA_URL --~--~-~--~~~---~--~~ You received this message because you are sub

Django and Eclipse Autocomplete NOT WORKING

2007-02-12 Thread johnny
I am using PyDev and Eclipse. For some reason I can't get Eclipse to do the autocomplete to work for python. Eclipse autocomplete work for other language and library packages. It does autocomplete for python, but not for Django. My django in python/ lib/site-packages/django. Is there something

Re: Django and Eclipse Autocomplete NOT WORKING

2007-02-12 Thread johnny
Thank you so much. On Feb 12, 10:38 am, "Igor Guerrero" <[EMAIL PROTECTED]> wrote: > You must add the app dir and django dir to the PYTHON_PATH env variable in > the preferrence menu and rescan the PATH. > > On 2/12/07, johnny <[EMAIL PROTECTED]> wrote: >

How do you display SplitDateTimeField in Template?

2007-02-12 Thread johnny
In my form, I have the following: appointment = forms.SplitDateTimeField(label='AppointmentAt', required = True ) What do you type in Template to get SplitDateTimeField? This is what I have, unfortunately this is not working.

Validation of Text Field + File Field

2007-02-12 Thread johnny
Case 1: When you have Validation for TextField and FileField on the same form, you enter the info and upload a file. When you hit submit, text form validation fails, that means the File is still sent to the server and server would have it in the memory. Now, I have to fix the TextField info with

syncdb on linux problem

2007-02-17 Thread johnny
I have moved my folder from Windows to Linux. It works fine when I try "python manage.py syncdb" on windows, exact same project code, in linux is not working, when I do "python manage.py syncdb". This is driving me crazy. I am getting following errors: Error: Couldn't install apps, because the

newb: date_of_birth field using SelectDateWidget

2007-02-27 Thread johnny
Can someone provide me an example for date_of_birth field using SelectDateWidget? 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@g

NOOB: default value in the ChoiceField?

2007-02-27 Thread johnny
Is there a way to set the initial or default value in the ChoiceField? I need to set a default Country. For example: country = forms.ChoiceField(label='Country', choices=[(c.id,c.name) for c in Countrylist.objects.all()], def

Re: newb: date_of_birth field using SelectDateWidget

2007-02-27 Thread johnny
I need to get it into Separate Year, Month, Day (1-31) Format using SelectDateWidget. On Feb 27, 11:59 am, "johnny" <[EMAIL PROTECTED]> wrote: > Can someone provide me an example for date_of_birth field using > SelectDat

Re: newb: date_of_birth field using SelectDateWidget

2007-02-27 Thread johnny
I have it like this in my form: birth= forms.DateField(SelectDateWidget('birth', years=range(today.year,1900,-1))) In my template: Date of Birth: {{ form.birth_year }} {{ form.birth_month }} and {{ form.birth_day }} {% if form.birth.errors %}*** {{ form.birth.errors|join:", " }}{% endif

Re: NOOB: default value in the ChoiceField?

2007-02-27 Thread johnny
I put in initial as a parameter. In the drop down list, or radio button, it does not highlight it anyway when you are at the page. If I look at the view source, it says, selected for drop down list and checked for radio button. Any idea why? On Feb 27, 5:50 pm, "Rubic" <[EMAIL PROTECTED]> wrot

Re: NOOB: default value in the ChoiceField?

2007-02-27 Thread johnny
It's working now. Thank you. On Feb 27, 8:52 pm, "johnny" <[EMAIL PROTECTED]> wrote: > I put in initial as a parameter. In the drop down list, or radio > button, it does not highlight it anyway when you are at the page. If > I look at the view source, it says, s

Re: newb: date_of_birth field using SelectDateWidget

2007-02-28 Thread johnny
Anyone? On Feb 27, 8:40 pm, "johnny" <[EMAIL PROTECTED]> wrote: > I have it like this in my form: > birth= forms.DateField(SelectDateWidget('birth', > years=range(today.year,1900,-1))) > > In my template: > > Date of Birth: {{

newb: Simple Question super(..).save()

2007-02-28 Thread johnny
What are the two parameters being passed, model name and instance? Eg: super(Snippet, self).save() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

newb: Prevent user Repeating SAME Tags over and over

2007-03-01 Thread johnny
Is there a way to get the user entered tags and store them in set (set contains unique items, no duplicates), so duplicates are eliminated and then you can save to the database? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed

newform: Post_add Submission not working

2007-03-01 Thread johnny
When I submit the information with the form, for some reason, I keep coming back to the form, with data I entered. I am not sure why this is the case. It should take the data, and save to the file. def add_post(request): if request.method == 'POST': form = forms.postForm(request.POS

newform: Post_add Submission not working

2007-03-01 Thread johnny
When I submit the information with the form, for some reason, I keep coming back to the form, with data I entered. I am not sure why this is the case. It should take the data, and save to the file. def add_post(request): if request.method == 'POST': form = forms.postForm(request.POS

Re: newform: Post_add Submission not working

2007-03-02 Thread johnny
I did place form.errors in the template. If I type the invalid data, then it displays the errors. Problem is when I type in valid data, it doesn't display anything and brings me back to the form with the data I have entered. Every frustrating problem. --~--~-~--~~~

Django and jsCalendar

2007-03-03 Thread johnny
Has anyone got Django and jsCalendar to work? Problem I am having is, Django has separate input field for DATE and TIME. jsCalendar combine both together. Even if I separate it manually, validation is failing. I have spent some days on this. Didn't get anywhere. I like jsCalendar for one re

Django and jQuery Autocomplete Routing Help

2007-03-05 Thread johnny
I am using jQuery to do the autocomplete. Autocomplete request backend script like this: script_url?q=foo. But there is a problem with django routing? (r'^tag/autocomplete/?q=(?P\w+)/$', 'apps.tag.views.tag_autocomplete'), Here is my error: [05/Mar/2007 15:11:51] "GET /tag/autocomplete/?q=a

Django ORM and Atomic Commit and Rollback

2007-03-07 Thread johnny
I have to update two models at the same time, if one model update fails, I need to rollback the transactions. How do you do this in Django ORM. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Django dev ProgrammingError 1064 MySQLdb/connections.py

2007-03-07 Thread johnny
There seem to be an error I am getting in Dev Version of Django, I just updated 1/2 hr ago. It's related to model back tracking, retrieving foreign key related objects, line 31: p.question_set.all, in template. ProgrammingError at /post/1/ (1064, "You have an error in your SQL syntax; check the

newb: Model.objects.select_related().get(id=4)

2007-03-08 Thread johnny
class City(models.Model): # ... class Person(models.Model): # ... hometown = models.ForeignKey(City) class Book(models.Model): # ... author = models.ForeignKey(Person) edited = models.ForeignKey(Person) If do this: Book.objects.select_related().get(id=4), Would it get on

Re: Django and jQuery Autocomplete Routing Help

2007-03-08 Thread johnny
I am new to python and javaScript, I have created a funtion that return the tags via ajax. I tried to replicate the php example. But it's not working. I doesn't return any tags back to my html page via ajax. I need some help. I am using jQuery autocomplete plugin from here: http://just-tech.

Django Automatic Page Refreshing

2007-03-11 Thread johnny
I have an online seminar booking application. What I want to know is, if 100 people are currently viewing a room that holds max 200 people, and one person out of 100 books the seat in the room, how do I refresh all the 100 pages so that they all have an updated version? Thank you. --~--~--

newb: Django & CountingDown

2007-03-14 Thread johnny
I have an app that is for online test taking. Most online test are 30 mins to 2hrs. I need to create count down clock from when the test is stared. If 30 mins test, then count down will start from 30 mins : 00 Secs, 29 min: 59 secs and so on. How do I do this? --~--~-~--~~---

newb: Django ORM for Custom SQL

2007-03-15 Thread johnny
I need to retrieve latest record (each record has a time stamp, created_at), only one record, from sale table where product_id=1. How do I do this in Django ORM? I have looked at .objects.extra{}, but I am getting ProgrammingError 1064. I need to get this sql into Django ORM: select created_at

newb: Newform conditional regexField

2007-03-16 Thread johnny
In newform, how do I allow a single regexField to accept either a whole number, or number with decimal places? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

newb: newforms and passing an extra parameter: forms.SalesForm(request.POST, p_id)

2007-03-16 Thread johnny
I have a forms.py that uses newforms. It has a class SalesForm(forms.Form). I need to pass an argument, p_id to SalesForm, which is used to retrieve related product from product model. When I run it, I get an error: Exception Type: TypeError Exception Value:__init__() takes exac

Re: newb: newforms and passing an extra parameter: forms.SalesForm(request.POST, p_id)

2007-03-16 Thread johnny
I did this: forms.SalesForm(request.POST, p_id). Inside class SalesForm(forms.Form) which init was overwrote, as you mentioned like below. Now within SalesForm, how do I get p_id? > class SalesForm(forms.Form): > def __init__(self, *args, **kwargs): > super(SalesForm, self).__init__(

Re: newb: newforms and passing an extra parameter: forms.SalesForm(request.POST, p_id)

2007-03-16 Thread johnny
I need to validate the data user enters, based on the product they have viewed. --~--~-~--~~~---~--~~ 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.co

  1   2   >