Calling remote API

2010-07-08 Thread james_027
hi all, It will be my first time to create django app that requires calling remote API. As far as I know django has no built in support for this. I only way I know is URLLIB2, any good library for this purpose, which easily send your request as get this parameters and also easily parse the return r

Multiple django version on developer machine

2010-05-11 Thread james_027
Hi all, While I have a number of django apps develop for Django 1.1 ... I also want to use Django 1.2 for my new project. How can I have multiple version of Django in my machine where my apps will be instructed either to use 1.1 or 1.2 Thanks, James -- You received this message because you are

django with other presentation solution

2007-11-27 Thread james_027
hi everyone fellow django users While I am having fun with django, but not with html/css/javascript (I am very bad at it). Any recommendation on making the presentation/view much painless. I am thinking of something like google web toolkit but this could mean a lot of work since the gwt is java a

Re: importing on models.py breaks somethings

2007-10-20 Thread james_027
hi, > "Doesn't work" is not very informative. Does it raise an error? Do > nothing? What is the difference between "works" and "doesn't work" in > this case. > What I mean by "doesn't work" is the in my forms.py it is giving an error that doesn't recognize the objects I have in my models.py jam

Re: importing on models.py breaks somethings

2007-10-20 Thread james_027
hi, > I can understand why your forms.py is importing models.py, but the > real question is: why is models.py importing forms.py? > I have a custom validation in some of my forms which need some of the object in my models.py. And I don't have my model.py importing forms.py. james --~--~--

importing on models.py breaks somethings

2007-10-20 Thread james_027
hi, i have made myself a module name utilities.py and shortcuts.py and place them in the root folder of my django app. When I use them in views.py or forms.py I just put a from app_name.shortcut import * from app_name.utilities import * but when I try to use it on my models.py in my forms.py i

Re: weird behavior of connection.cursor.execute()

2007-09-30 Thread james_027
anyone who has opinion on this? thanks james On Sep 29, 10:01 am, james_027 <[EMAIL PROTECTED]> wrote: > hi all > > the 2 methods below have no errors but are different in a way that the > first one doesn't give me the resultset in the order that I want while > the

weird behavior of connection.cursor.execute()

2007-09-28 Thread james_027
hi all the 2 methods below have no errors but are different in a way that the first one doesn't give me the resultset in the order that I want while the second method give me the resultset in the right order that I want. first method def sales(self, year=datetime.today().year, order_by='Custome

newforms to validate if unique

2007-09-04 Thread james_027
hi, how do I use the newforms for creating an object that has an attribute with unique = True? Thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

redirect with query

2007-09-02 Thread james_027
hi, is there a django/pythonic way to do this return HttpResponseRedirect('/main?app_message=you have no permission on %s vs ' % (function)) can the reverse() help? I think the args and kwargs are for the methods parameters ... Thanks james --~--~-~--~~~---~--~---

Re: using defaultdict on django

2007-08-24 Thread james_027
Hi, Anybody has an idea about this? Thanks james On Aug 24, 3:27 pm, james_027 <[EMAIL PROTECTED]> wrote: > hi, > > I am using defaultdict to gather organize some data on request.POST. > but the result seems to be different when execute outside django ... > > inside

Re: Help needed

2007-08-24 Thread james_027
Hi ani, On Aug 24, 3:42 pm, Ani Nair <[EMAIL PROTECTED]> wrote: > Hi I'm new to this.. I want to know whether django restricts the use > of '?' in urls. I am unable to use it in the url config My guess is that "?" is a special char in regex which django uses in url config... try to escape it. Ho

using defaultdict on django

2007-08-24 Thread james_027
hi, I am using defaultdict to gather organize some data on request.POST. but the result seems to be different when execute outside django ... inside django I could get this result ... {u'item': [u'727'], u'unit_price': [u'5.50'], u'qty': [u'']} {u'item': [u'2'], u'unit_price': [u'23500.00'], u'

ModelChoiceField on newforms

2007-08-17 Thread james_027
hi, while learning and experimenting with forms ... one should use ModelChoiceField in order to let newforms bind the value on a foreignkey field of a model. My concern is that in the real world, you usually don't use to let the user chose the value to be filled especially if the list of choice

production instance on windowsxp

2007-08-15 Thread james_027
Hi, Ask I have successfully try to run django apps on apache/mod_python/ winxp, I learn that apache for winxp only support worker_mpm oppose to what django is suggesting (prefork_mpm). Should I worry about this? Or should I go with fast cgi? THanks james --~--~-~--~~~-

Re: Installing django on a vm using NAT - SVN 400 bad request

2007-08-13 Thread james_027
Hi, On Aug 14, 9:36 am, sanchothefat <[EMAIL PROTECTED]> wrote: > Hi, I'm trying to get django going on a debian etch vm I have which > uses NAT to access the web. I found some info that suggested using https:// > but that won't work. > Should I try ubuntu or is there something in the vm settings

Re: context processors execution

2007-08-13 Thread james_027
hi Matt, On Aug 13, 3:13 pm, "Matt Davies" <[EMAIL PROTECTED]> wrote: > James, are you talking about putting a context processor into the > settings.py file? > yes, and also context processor called as argument on views by ContextRequest() Thanks james --~--~-~--~~~---

Re: context processors execution

2007-08-12 Thread james_027
hi, someone to confirm this? thanks james On Aug 10, 10:29 am, james_027 <[EMAIL PROTECTED]> wrote: > hi, > > Are the context processors executed only when you pass a request > context from view to template? The documentation mentions that a > requestcontext could accept

Re: editing newforms field

2007-08-10 Thread james_027
Hi, On Aug 10, 4:12 pm, Collin Grady <[EMAIL PROTECTED]> wrote: > Yes, just edit the fields in form.fields :) I am sorry, I didn't make it clear, I mean changing it like in views? james --~--~-~--~~~---~--~~ You received this message because you are subscribed

editing newforms field

2007-08-10 Thread james_027
hi, is it possible to edit the newforms field like required from true to false? or editing the widget property? Thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: django built-in web server

2007-08-10 Thread james_027
Hi, > > > I am very newbie, > > and trying to avoid apache > > why? > Just in case a problem occur, I think it could be more easy to troubleshoot it without being a apache expert? Or if threre's a patch for the client's program that need to be apply it could be much easier? THanks james --~--

django built-in web server

2007-08-09 Thread james_027
hi, Can I use the django's built in web server in an intranet enviroment where the maximum users could be not more than 50 users? I am just asking this for the purpose for easy deployment :). I am very newbie, and trying to avoid apache THanks james --~--~-~--~~~---

Re: Is this not allowed select_related()

2007-08-09 Thread james_027
THanks Doug > > class Employee(models.Model): > # your employee model fields here, no FKs to Contact or > Assignment models > ... > > class EmployeeAssignment(models.Model): > active = models.BooleanField() # I added this > employee = models.ForeignKey(Employee) > ... > > c

scheduling job

2007-08-09 Thread james_027
hi, This might not be a django stuff, but how could I write something that will execute itself depending on the frequency that I'll set. For example, since django session table needs to be clean up at a certain time, I want to write a script that will execute itself monthly to clean up the sessio

url styling

2007-08-09 Thread james_027
hi, is there any advantage or disadvantage or best practices in forming urls? like which set are much better? domain/employee/1 domain/edit_employee/1 domain/inactive_employee/1 or domain/employee/1 domain/employee/1/edit/ domain/employee/1/inactive/ thanks james --~--~-~--~~---

Re: pagination for search result ...

2007-08-09 Thread james_027
hi, On Aug 10, 11:25 am, "Kai Kuehne" <[EMAIL PROTECTED]> wrote: > On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > > > hi, > > > > def list_filter(request): > > > """Update session filter"&qu

Re: Is this not allowed select_related()

2007-08-09 Thread james_027
hi collin, On Aug 10, 11:26 am, Collin Grady <[EMAIL PROTECTED]> wrote: > What do you mean by "get the history" ? the employee could have new contract & assignment as months goes by. the employee_contract & employee_assignment tells of their recent contract & assignment. while the employee attri

Re: pagination for search result ...

2007-08-09 Thread james_027
hi, > def list_filter(request): > """Update session filter""" > # request['filter'] is a hidden field. frankly, I don't know if > this is really needed. > # I added it in case I add another form to the template > if request.method == 'POST' and request['filter'] == '1': >

Re: Is this not allowed select_related()

2007-08-09 Thread james_027
hi, On Aug 9, 11:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > He means that you can remove: > > employee = models.ForeignKey(Employee) > > from your 'EmployeeAssignment' and 'EmployeeContract' models because > the relationship is already defined in your 'Employee' model. You can >

context processors execution

2007-08-09 Thread james_027
hi, Are the context processors executed only when you pass a request context from view to template? The documentation mentions that a requestcontext could accept an optional argument which is a context processor, is it the same as putting the context processor in the context processor settings bu

Re: pagination for search result ...

2007-08-09 Thread james_027
Hi Kai, > > Do you mean that the filter works on the first page but > is lost when you go to another page? If yes: > I save my filter in a session and filter on each page using > that filter values (the values that were given to the input fields > of the filter form). I don't know whether this is

pagination for search result ...

2007-08-09 Thread james_027
hi, I am trying to put a page list for a search result. So far here's what I've try by using the django.views.generic.list_detail.object_list and the pagination tag (http://code.djangoproject.com/wiki/PaginatorTag) and later found out that it won't meet my needs. def search_employee(request):

getting pagination tag to work

2007-08-09 Thread james_027
hi, I am trying to do this http://code.djangoproject.com/wiki/PaginatorTag I have two apps in my projects which are main and manning. I put the pagination tag code in the main/templatetags/extra_tags.py file. And I am trying to use the tag from a template in manning/templates/ results.htm. But I

Re: Is this not allowed select_related()

2007-08-08 Thread james_027
Hi collin On Aug 9, 1:06 pm, Collin Grady <[EMAIL PROTECTED]> wrote: > Because you have an infinite loop there. > > Why are you linking both directions? There's a reverse relation > available to get from EmployeeAssignment and EmployeeContract back to > the Employee model, you don't need to expli

context vs request context

2007-08-08 Thread james_027
Hi, While I was studying the list generic view. I ask myself why does the django generic view list uses request context to store the pagination related info instead of a regular context. If I understand it right, using the request context could provide additional info from the context processor

Is this not allowed select_related()

2007-08-08 Thread james_027
hi, I have this model which doesn't work when using select_related(). What happen is django seems to be in a infinite loop. class Employee(models.Model): employee_contract = models.ForeignKey('EmployeeContract', related_name='contracted_employee') employee_assignment = models.ForeignKey

django.views.generic.simple

2007-08-08 Thread james_027
hi, is the purpose of this view for showing static html page? if not what is the use of this view? Thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: using chaining filter() and select_related()

2007-08-07 Thread james_027
hi On Aug 8, 1:45 pm, Margaret <[EMAIL PROTECTED]> wrote: > how > > employees = employees.join(employees.filter(Q(firstname = p) | Q(lastname= > p))) > is this something new that hasn't been yet documented? james --~--~-~--~~~---~--~~ You received this message

Re: using chaining filter() and select_related()

2007-08-07 Thread james_027
Hi, On Aug 8, 1:37 pm, Udi <[EMAIL PROTECTED]> wrote: > Try doing the select_related() at the end > > Remove the first use of it and then after the loop add this: > employees = employees.select_related() > > I think that'll work? > I try but it didn't work ... james --~--~-~--~~--

using chaining filter() and select_related()

2007-08-07 Thread james_027
hi, I am doing something like this params = request.GET['name'].split() employees = Employee.objects.all().select_related() for p in params: employees = employees.filter(Q(firstname = p) | Q(lastname = p)) the query is fine but when I look at the connection.

Re: multiple user account login

2007-08-07 Thread james_027
Hi, > I think the OP is asking for the ability to have more than one > different user simultaneously logged into the web app. This > isn't conventionally feasible. You can use multiple browsers > (I've used FireFox, IE, Lynx, and Dillo for testing various users > at the same time) or possibly e

multiple user account login

2007-08-07 Thread james_027
Hi, How do I enable multiple user account login in one computer? I don't know what is the disadvantage if this works this way, I just need it for development and testing purpose. Thanks james --~--~-~--~~~---~--~~ You received this message because you are subscr

weird django orm behavior

2007-08-06 Thread james_027
Hi, I have this models ... class Employee(models.Model): emplyoee_contract = models.ForeignKey('EmployeeContract', null=True, related_name='contracted_employee') employee_assignment = models.ForeignKey('EmployeeAssignment', null=True, related_name='assigned_employee') class EmployeeAss

Re: elseif or elseifqual or elseifnotequal

2007-08-06 Thread james_027
hi kai! thanks a lot. this will help a lot. cheers, james On Aug 6, 4:02 pm, "Kai Kuehne" <[EMAIL PROTECTED]> wrote: > Hi James, > > On 8/6/07, james_027 <[EMAIL PROTECTED]> wrote: > > > Just want to confirm if elseif and the alike doesn't exis

elseif or elseifqual or elseifnotequal

2007-08-06 Thread james_027
Hi, Just want to confirm if elseif and the alike doesn't exist in django's template. What tricks could be give to newbies if something like is needed ... if bool: elseif bool: elseif boo: it could be not nice to do something like this in django's template {% if bool %} {% else %} {%

an application with print on dot matrix printer

2007-08-05 Thread james_027
hi, what is the nice way to provide a print function on a dot matrix printer for django apps aside from generating a printer friendly page? Thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi Kai, > If you do not use it, no. > If I use it, how does it affect then? thanks james --~--~-~--~~~---~--~~ 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@go

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi, On Aug 3, 4:32 pm, koenb <[EMAIL PROTECTED]> wrote: > My guess is you are interfering with your admin_media (look at the > admin_media_prefix setting). > Try using something like r'^sitemedia/... and src="/sitemedia/...". > Thanks koen, that did it. I think it could be nice if it was mention

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi, are this settings used when running under development mode? MEDIA_ROOT MEDIA_URL does it affect the django.views.static.serve? thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi, I already did the (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root':'d:/private/james/documents/django/ksk/media'}), in my urls.py and in my template i have something like this but why is it the image still don't appear? Thanks james --~--~-~--~~--

Re: how to handle forms with more than submit button

2007-08-02 Thread james_027
Hi, On Aug 3, 11:21 am, Doug B <[EMAIL PROTECTED]> wrote: > As far as I know a form submits to a single url via the action=? > specifier. That's just the way an html form works. Each submit > button that is part of the form is going to post to the action url in > the form. You can override wit

Re: how to handle forms with more than submit button

2007-08-02 Thread james_027
hi, On Aug 3, 11:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Oh... forgot the semicolons after .submit(); but you get the picture > thanks carole, yes I the picture. so its about javascript not django ... cheers, james --~--~-~--~~~---~--~~ You rece

Firebird support

2007-08-02 Thread james_027
Hi, anybody here heard of firebird database? how can I get support from django? Thanks james --~--~-~--~~~---~--~~ 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@

Re: how to handle forms with more than submit button

2007-08-02 Thread james_027
hi > create different URLs (and thus different views) for the different > buttons and then redirect to wherever you want to go. > How do I create a different URL for different buttons but under one form? Thanks james --~--~-~--~~~---~--~~ You received this mes

how to handle forms with more than submit button

2007-08-02 Thread james_027
Hi, How do I handle this situation wherein I want different submit button to call different method on the views. I feel that calling the same method on views for all the submit button on a form is not good, as you'll make the distinction of what to do inside the method... Thanks james --~--~--

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-02 Thread james_027
H On Aug 2, 11:35 pm, Nathan Ostgard <[EMAIL PROTECTED]> wrote: > You can use ModelMultipleChoiceField for this: > > items = > newforms.ModelMultipleChoiceField(queryset=Items.objects.all()) > I don't see ModelMultipleChoiceField on the documentaion or the latest source code Thanks james --~-

value for choices arguments for newforms.MultipleSelectField

2007-08-02 Thread james_027
hi somewhere on the django documentation I saw the choice provided for MultipleSelectField is from a Database but I can't recall where I read it but I do it this way, let me know if there are better alternative items = newforms.MultipleChoiceField(choices = [('i.id', 'i.name') for i in Items.obj

Django equivalent of ROR flash

2007-08-02 Thread james_027
Does Django have this http://api.rubyonrails.com/classes/ActionController/Flash.html Thanks james --~--~-~--~~~---~--~~ 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

something I really don't know in using manage.py shell

2007-08-01 Thread james_027
hi, i am trying to use the manage.py shell, for fast testing of what I would like to do. I have a model like this class Function(models.Model): """Functions that KSK Employee account could use""" name = models.CharField(maxlength=40) url = models.CharField(maxlength=40, default='/'

Re: default behavior of django.middleware.transaction.TransactionMiddleware

2007-08-01 Thread james_027
hi, anyone to clarify this? On Jul 17, 4:54 pm, james_027 <[EMAIL PROTECTED]> wrote: > hi, > > If I use django.middleware.transaction.TransactionMiddleware, is > @transaction.commit_on_success the default behavior? or I should > always call on the python decorator

Re: understanding request.user

2007-08-01 Thread james_027
hi, > request.user gets created by to OR mapping (from the sql database). > request.session comes from a pickle (serialized to a bytestream). > > Both needs to be done for every request. You could use caching, > but object caching (like for request.user) is not possible up to now. > Just like w

understanding request.user

2007-08-01 Thread james_027
hi, I am seeking some enlightenment as why the user (variable use to track if the user is logged in or not) seems to be on the request level and not on the session which is the practice of most or all of web framework? If I am not wrong request.user is done on the middleware which will get execut

remember me feature

2007-07-31 Thread james_027
hi, is implementing remember me feature for login is as simple as changing the cookies settings in the settings.py? is manipulating of setting.py allowed in views? THanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: how to overcome {% if %} limitation

2007-07-31 Thread james_027
Thanks everyone! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTE

Re: learning django's HttpRequest Object and Middleware

2007-07-31 Thread james_027
Hi Thomas > The methods of each middleware are called one for every request. If your > changes need information from the request, that's the right place. > > If you want to add a method which should be added once the server (mod_python, > scgi, ...) starts you can use this place too. But it is be

learning django's HttpRequest Object and Middleware

2007-07-31 Thread james_027
Hi, I want to make sure that my understanding is right. is middleware the place where I can add more attribute to the HttpRequest Object and manipulate the added attribte? Is this advisable? if Not where is the right place to do it? Thanks james --~--~-~--~~~---~--

how to overcome {% if %} limitation

2007-07-31 Thread james_027
Hi, I am very new to django, now I am dealing with templates. Coming from JSP, I am suprise that in django we can't do something like {% if Events.objects.filter(...).count > 10 %} Is there a way to do something like that? Thanks james --~--~-~--~~~---~--~~ You

Re: overiding the clean method on newforms

2007-07-30 Thread james_027
Hi, > > http://django-registration.googlecode.com/svn/trunk/registration/form... > Thanks Nathaniel, I am looking for over riding the clean() instead of clean_(). After hours of experiments. I would like to confirm if my learnings are correct. in over riding the clean() method, I have to f

retaining the data on validation error using newforms

2007-07-30 Thread james_027
Hi, this is how I am using the newforms. My Form class NewEmployeeForm(forms.Form): contract_from = forms.DateField() contract_to = forms.DateField() position = forms.CharField(max_length=20) My View def create_employee(request): f = None if request.method == 'POST':

overiding the clean method on newforms

2007-07-30 Thread james_027
Hi, is there any sample on over riding the clean method of the newforms? Thanks james --~--~-~--~~~---~--~~ 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@googleg

Re: newforms: common constraints

2007-07-29 Thread james_027
hi, what will be the proper approach to do this? creating a custom fields or custom field validation? Thanks james On Jul 27, 10:53 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > On 7/27/07, james_027 <[EMAIL PROTECTED]> wrote: > > > but those min m

error on models with foreign key on each other

2007-07-29 Thread james_027
Hi, I am trying to migrate an existing application to django. I am encountering the following problem with this models D:\private\james\documents\django\ksk>python manage.py validate manning.employee: Reverse query name for field 'employee_contract' clashes with field 'EmployeeContr act.employee

adding contraints on admin

2007-07-27 Thread james_027
Hi, I really love Django admin, however how can I add customer validation or contraints to my models? Thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: newforms: common constraints

2007-07-26 Thread james_027
Thanks for the fast response Doug, but those min max constraints are so common? why not include it? james On Jul 27, 1:20 pm, Doug B <[EMAIL PROTECTED]> wrote: > Garg, hit enter too fast. > > Class MyForm(forms.Form): > username = forms.CharField(max_length=12) > def clean_username(self

newforms: common constraints

2007-07-26 Thread james_027
Hi all, I may not well understand the purpose of newforms, or perhaps it is still in a very early alpha stage ... I am looking to implement some common constraints like mininum or maximum letter of character field then values for numerical field., range for numerical or date field. Thanks james

Re: learning django testing

2007-07-26 Thread james_027
Thanks bob cheers, james On Jul 25, 11:48 pm, "Bob T." <[EMAIL PROTECTED]> wrote: > > I don't have any idea what is the > > testing all about. > > James, you might want to take a look at Dive Into Python [1] as a > starting place. It has a couple good chapters on testing and test > driven develo

middleware or context_processors

2007-07-26 Thread james_027
Hi all, As I am trying to extend the django user model not using the auth_profile I have model like this class Profile(models.Model): """KSK Employee accounts to use this application""" user = models.ForeignKey(User, unique=True) department = models.CharField(maxlength=3, choices=D

Re: latest django version

2007-07-25 Thread james_027
hi oggie, On Jul 26, 3:39 am, oggie rob <[EMAIL PROTECTED]> wrote: > Re: TortoiseSVN, take a look athttp://tortoisesvn.net/node/87 > Short story - unless you can get your admin to change your firewall, > you can't use svn since "code" doesn't respond to https, no matter > which platform you are u

learning django testing

2007-07-24 Thread james_027
hi, Here's another newbie stupid question ... I've heard testing everywhere from software development world, and the testing I know is to run the application I am developing and do all the possibilities that I user might do to make sure that the application behaves how it should be. I am studyin

latest django version

2007-07-22 Thread james_027
Hi, I would like to use the latest django version. i am trying to use tortoise SVN to get the latest version, but iam always getting this error Error * REPORT request failed on 'http://code.djangoproject.com/svn/ django/trunk/django' REPORT of 'http://code.djangoproject.com/svn/ django/trunk/dja

Re: foreign key on database not created with models referencing from other application

2007-07-22 Thread james_027
Thanks russ I greatly appreciate it!, I'll just wait for the fix. cheers, james On Jul 22, 11:01 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/22/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > the profile table's dell has cons

Re: foreign key on database not created with models referencing from other application

2007-07-21 Thread james_027
On Jul 22, 11:37 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/22/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > 5. then i run python manage.py syncdb > > > the result is ... in my cellusage table there is no foreign key > &

Re: foreign key on database not created with models referencing from other application

2007-07-21 Thread james_027
INSTALLED_APPS has effect when performing manage.py syncdb? iam using django .96, my python mysql driver is the latest version., i am doing this on windows env. Thanks Russ for helping me on this, i greatly appreciate it. james On Jul 21, 9:07 pm, "Russell Keith-Magee" <[EMAIL PRO

Re: foreign key on database not created with models referencing from other application

2007-07-20 Thread james_027
een the first and the second and the result is constant. do we have ordering in creating models? thanks james On Jul 21, 12:49 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/21/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > I didn't say

Re: foreign key on database not created with models referencing from other application

2007-07-20 Thread james_027
e" <[EMAIL PROTECTED]> wrote: > On 7/21/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > I am doing this in winxp , mysql 5 , python 2.5 , latest mysql driver > > for python. Hope I've provided enough info. > > Not even close. > > Perhaps I'

Re: foreign key on database not created with models referencing from other application

2007-07-20 Thread james_027
h info. Thanks james On Jul 21, 10:38 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/21/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > When the relationship is within the same namespace (am I using the > > right term, pls correct me) th

foreign key on database not created with models referencing from other application

2007-07-20 Thread james_027
I am very new to django, I am creating a model with a field of models.ForeignKey(User) #django.contrib.auth.models import User. When I look at the database, my table has no foreign key define. Another example is the django.contrib.admin.models.LogEntry model it has user = models.ForeignKey(User) w

Re: shortcut for assigning values to model?

2007-07-20 Thread james_027
ndroMat <[EMAIL PROTECTED]> wrote: > > > > On 20 jul, 10:53, james_027 <[EMAIL PROTECTED]> wrote: > > > > > hi, > > > > > is there a short cut for assigning input data to model's data > > > > attribute? > > > >

shortcut for assigning values to model?

2007-07-20 Thread james_027
hi, is there a short cut for assigning input data to model's data attribute? if Book is a model then b = Book(request.POST) b.save() the assignment will be done on all the match key of the request.POST QueryDict and data attribute of the Book Model. or if BookForm is a newform then bf = Bo

Re: newforms

2007-07-20 Thread james_027
form or something > ? If so, can somebody post a screenshot please ? > > Alper KANAT ([EMAIL PROTECTED])http://raptiye.org > > Thomas Guettler yazmış: > > > Am Freitag, 20. Juli 2007 07:53 schrieb james_027: > >> Which official django apps are using the newforms? I

newforms

2007-07-19 Thread james_027
Which official django apps are using the newforms? I just want to take a look at the coding as I am trying to learn the django's newform thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

setting up login required pages massly

2007-07-19 Thread james_027
hi, is there a stupidly fast way to make select but many pages to required login first? I am using 0.96 @login_required is cool, but 0.96 doesn't support LOGIN_URL in the settings.py yet. currently i am using something like this if not request.user.is_authenticated(): return render_to_r

Re: django foreignkey

2007-07-19 Thread james_027
hi, it seems that there is a small bug for not creating the foreign key on the database. Please see this ticket. http://code.djangoproject.com/ticket/4930#preview Thanks james On Jul 20, 9:05 am, james_027 <[EMAIL PROTECTED]> wrote: > anyone to help me on this? > > thanks >

Re: django foreignkey

2007-07-19 Thread james_027
anyone to help me on this? thanks james On Jul 19, 3:20 pm, james_027 <[EMAIL PROTECTED]> wrote: > Hi Nathan, > > I did manage.py syncdb with the table still not existing. I did > manage.py sqlall myapps when saw that the foreign key was not created. > > here is my actu

Re: login() method conflict

2007-07-19 Thread james_027
; Then use: > user = auth.authenticate(username='foo', password='bar') > auth.login(request, user) > > On Jul 19, 1:02 am, james_027 <[EMAIL PROTECTED]> wrote: > > > hi, > > > i've been trying to get started with django and i am stock in this &

login() method conflict

2007-07-19 Thread james_027
hi, i've been trying to get started with django and i am stock in this problem and found out that there's a conflict in login() method. here is my view code from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.contrib.auth import

Re: django foreignkey

2007-07-19 Thread james_027
[EMAIL PROTECTED]> wrote: > manage.py syncdb won't add new fields to the database if the table > already exists. You'll have to do this yourself. See manage.py sqlall > for some help. > > Otherwise, if you have: user = models.ForeignKey(User), then look for > a field

django foreignkey

2007-07-18 Thread james_027
hi, I have a model with a field models.ForeignKey(), with manage.py validate I check if my code are right, then run manage.py syncdb. When I was checking the tables generated I don't see any foreign key created? Is there something wrong? where should I check? I am using django 0.96, mysql 5 on w

Re: context processor question

2007-07-18 Thread james_027
Hi Jeremy, I am a bit lost ... where do I apply that? Isn't that I just call the variable name/dict key in the template? Thanks james On Jul 19, 11:18 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 7/18/07, james_027 <[EMAIL PROTECTED]> wrote: > ...

context processor question

2007-07-18 Thread james_027
Hi, As I understand context are data we can use in our templates, and the purpose of context processor is instead of doing something like c = Context({ 'latest_poll_list': latest_poll_list, }) or return render_to_response('polls/index.html', {'latest_poll_list': latest_poll_list})

  1   2   >