failover partner
hi all, i am trying to connect to mssql server using pyodbc. i am connecting to two databases each one on defferent instances, one is default instance and another is client instance. whenever my default instance mssql server is runnning, i can access both instances database. but when my default instance mssql server is not runnning, i can not access any instances database. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Printing a modified list value
I'm having a problem when printing the template. I want something like: {% i in item %} {{ form.{{i}}.error }} {{ {{i}}_max }} {{ {{i}}_min }} {% endfor %} -- which obviously doesn't work so, from my views.py I passed in a dictionary containing, a list of items - [a, b, c, d], a list of form - [a,b,c,d] as well as a_max, a_min, b_max, b_min, etc ... what I want to do is to print the actual value of a_max, a_min, b_max, b_min, using the for loop (so I don't have to hard code it. Is there any way to achieve this? I mean how to call a { } inside another { } I've tried using expr: {% expr i+'_max' as maximum %} {{ maximum }} -- but (as expected), it printed the word "a_max" instead of the actual value of a_max (e.g: 9) Any comments/suggestion would be greatly appreciated. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Arithmetic operations in a templete
How to add suffix/prefix in a template? So if i passed in a list name- [a,b,c,d] and a_max, b_max, etc from views.py. and I do something like {% for i in name %} {{ i_max}} {% endfor %} so I actually wants to print the value of a_max, b_max, etc. Is there a way to do this? or I have to hardcode the code instead of using for loop? On Aug 23, 11:01 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > I know my question could be a bit silly but... I dont know how to do > > it. Do anybody know how to do arithmetic operations in a templete? > > > {{elem}} > > > what I want to do is something like {{ elem }} + 100 > > There's an "add" filter... > > http://www.djangoproject.com/documentation/templates/#add > > {{ elem|add:100 }} > > -tim --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Arithmetic operations in a templete
So now, I passed in as dictionary data = { a: a_stuff, b: b_stuff, ... } where a_stuff and b_stuff is also a dictionary, a_stuff {a_max:9, a_min:0, .. etc} when i use {% for key,value in data.items %} {{key}}, {{value}} {%endfor%} it doesn't print anything, but when i do {% for key in data.items %}{{key}}{%endfor%} it prints : ('a', {'a_max': 9, 'a_min': 0, etc}), did i pass the data incorrectly or something? On Aug 24, 12:51 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 8/23/07, *San* <[EMAIL PROTECTED]> wrote: > > > > > How to add suffix/prefix in a template? So if i passed in a list name- > > [a,b,c,d] and a_max, b_max, etc from views.py. and I do something like > > > {% for i in name %} > > {{ i_max}} > > {% endfor %} > > > so I actually wants to print the value of a_max, b_max, etc. Is there > > a way to do this? or I have to hardcode the code instead of using for > > loop? > > In your example, there's no need to pass in the list of names - you > are only iterating over the values. However, assuming that you > actually need the name: If a is related to a_max, then pass in context > data that expresses that relationship. Don't pass in two disconnected > lists - pass in a dictionary: > > data = { a: a_max, b: b_max, ... } > > Then in the template: > > {% for key, value in data.items %} >{% key %} = {% value %} > {% endfor %} > > Yours, > Russ Magee %-) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
extending the User Model error
I was trying to extend the user model as described here: http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model but, when I tried to view it, I got an error: Cannot resolve keyword 'user' into field Here's my view.py def profile(request, username): uname = User.objects.get(username=username) profile = uname.get_profile() gender = profile.gender age = profile.age return render_to_response('home.html', {'detail' : uname, 'gender' : gender, 'age' : age}) Anyone know whats wrong with it? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: extending the User Model error
It works, yay Thanks heaps On May 5, 5:12 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 5/4/07, *San* <[EMAIL PROTECTED]> wrote: > > > but, when I tried to view it, I got an error: > > Cannot resolve keyword 'user' into field > > The field on your profile model **must** be named "user". > > So, for example, this will work: > > class MyProfile(models.Model): > mailing_address = models.TextField() > user = models.ForeignKey(User, unique=True) > > But this will not, because the relation back to the User model is not > a field named "user": > > class MyProfile(models.Model): > mailing_address = models.TextField() > django_user_account = models.ForeignKey(User, unique=True) > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django and aws elastic beanstalk
For requirements.txt, you have to run > pip freeze > requirements.txt For the second error, you have to run > eb config Then change WSGIPath to point to your wsgi.py file. On Thursday, July 14, 2016 at 4:32:47 AM UTC-7, mat...@vogcalgaryappdeveloper.com wrote: > > Hi, I’ve been directed to you for technical support regarding Django. I > can get it working on my own computer running on the provided local server > however when I follow any tutorial to host it on elastic beanstalk I get > one of two of the following errors: > > “ERROR: your requirements.txt is invalid.” > > “ERROR: WSGIPath refers to a file that does not exist.” > > > > I’ve tried everything I can think of but nothing seems to work. > > I look forward to hearing back from you and hope that you can help me with > this. > > > > > > Matthew Bates > VOG Calgary Developer Inc - We Are Mobile Development Professionals > Phone: (403) 399-2519 || Email: mat...@vogcalgaryappdeveloper.com > > 1900 11 Street SE,Suite 150, Calgary, AB T2G 3G2 > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0cd3efa2-b2ec-4234-b29e-a7dbe31486ae%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.