Re: Why can't forms access the request object?

2012-03-11 Thread Sergiy Khohlov
Of course form does not have access to the object. But you can pass some value which is accessible in view from view to form. Separating task in 2 parts : 1) set initial values in view class class myviewclass(): """ This is example only . full class realization is more complex """ form

Re: Why can't forms access the request object?

2012-03-12 Thread Sergiy Khohlov
Shacker, Django migrates from function based view to the class based. It will be nice to catch a good resource about class view usage because official documentation is very poor. 2012/3/12 shacker : > Thanks for the explanations Masklinn and dstuffte - this makes a lot more > sense now. I guess

help with form validation

2012-03-13 Thread Sergiy Khohlov
Hello, I would like to ask question about form error handling. Main target is decreasing count of the code in the template. Of course it is possible to display all form in template such as : {{ form.as_table }} In this case possible to set some widget in form and make a template code is simple.

Re: Keep getting 404 error

2012-03-25 Thread Sergiy Khohlov
try to open http://127.0.0.1:8000/hello 2012/3/25 Sithembewena Lloyd Dube : > Hi Mika, > > Welcome to Django. > > I think the issue is that the URL 'http://127.0.0.1:8000/' merely points to > your local machine's port (8000), whereas you want to browse to > 'http://127.0.0.1:8000/hello/' - which i

Re: canceling account

2012-03-31 Thread Sergiy Khohlov
Hello, What do you mean ? Each django application has ability to add django superuser account. Also hoster company provide a account for setting django application at the host. Please clarify what do you want to do Thanks, Serge 2012/3/31 Lillian Cauldwell : > > My previous webmaster se

Re: I don't get what Poll.objects.get(pk=1) does

2012-03-31 Thread Sergiy Khohlov
look like all is correct. it will be nice to separate a working with database and python object. Using pk=1 you will get object with primary key equal 1. Also yo will try to worki wit object as with list... thanks, serge 2012/3/31 excalibur1491 : > Hi, > > I'm learning Django (I already kn

Re: form.Forms + POST + forms.ChoiceField

2012-04-02 Thread Sergiy Khohlov
So much code ;-) at first I'm proposing to add some code for form.is_valid block for example : if form.is_valid(): source = Sources.objects.get(name=source) allPosts = Posts.objects.filter(PostSource=source) subreddits = SubReddits.objects.all()

Re: form.Forms + POST + forms.ChoiceField

2012-04-02 Thread Sergiy Khohlov
Ok. I'm not definitely sure what you want to have but I'm proposing to do simple project with next functionality: 1) prepare list of the links 2) ability to click at the link and receive some additional information about link 3) button for deleting of the link 4) button for creating

Re: Django: 404 page not found

2012-04-02 Thread Sergiy Khohlov
please post section of the setting.py file TEMPLATE_CONTEXT_PROCESSORS Has this file 'django.core.context_processors.static', 2012/4/3 Homer : > I think "media_root" works well since I also used pictures on my another > page. Maybe there is something wrong in my urlconf... > > 在 2012年4月2日星期一

Re: form.Forms + POST + forms.ChoiceField

2012-04-03 Thread Sergiy Khohlov
try to use django generic class view https://docs.djangoproject.com/en/dev/topics/class-based-views/ Sorting is added by adding next construction to the your class view: class yourclassview(ListView): """ model = yourmodel context_object_name = 'object_or_list' templat

Re: Why using Generic Views?

2012-04-03 Thread Sergiy Khohlov
Generic views helps to avoid writting some part of the trivial code. For example : you are writing a shop with goods and a lot of the pages contains list of the items. You should about sorting orders, page selecting etc. If you are using generic views then you might not spend time at this. A

Re: Django Contrib Auth + Class Based Generic Views

2012-04-03 Thread Sergiy Khohlov
Please provide your urls.py and your view which is used for this 2012/4/3 Matheus Ashton : > Hello Everybody, > > I'm having a problem using the django.contrib.auth app and class based > generic views in Django 1.3 / 1.4: > > After submitting the login form, my view receives the post data a

Re: Django: 404 page not found

2012-04-03 Thread Sergiy Khohlov
this section from my last project : TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static',

Re: Django: 404 page not found

2012-04-03 Thread Sergiy Khohlov
Could you please add your setting.py from root of the your project to your letter ? 2012/4/3 Homer : > I add the section you provided to my settings.py but it still does not > work... > > 在 2012年4月3日星期二UTC-4上午8时57分57秒,skhohlov写道: >> >> this section from my last project : >> >> >> TEMPLATE_CONTEX

Re: Django Contrib Auth + Class Based Generic Views

2012-04-04 Thread Sergiy Khohlov
gt;         return self.user >       else: >         raise UserDisabledException("Usuario inativo") >     else: >       raise InvalidLoginException("Usuario/Senha invalidos") > > class UserDisabledException(Exception): >   def __init__(self, value): >     self.value

Re: Django Contrib Auth + Class Based Generic Views

2012-04-04 Thread Sergiy Khohlov
Sound good! Usually project is not so simple (only url.py + settings.py) 2012/4/4 Javier Guerra Giraldez : > On Wed, Apr 4, 2012 at 4:14 AM, Sergiy Khohlov wrote: >> As result  your views.py should be : >> >> from django.views.generic import TemplateView >> # Creat

Re: Django Contrib Auth + Class Based Generic Views

2012-04-04 Thread Sergiy Khohlov
> access the HomeView the template is rendered with a render_to_response view, > with a simple Context object and not a RequestContext object, because of > that I do not have the authenticated user data in my template... > > > 2012/4/4 Sergiy Khohlov >> >> Sound good

Re: How to call perl script in my django application

2012-06-18 Thread Sergiy Khohlov
Such as in trivial python code . Check python system and os module 2012/6/18 Tanveer Ali Sha : > Hello, > > how can I call Perl script (EX:hello world) in my django application ? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > T

Re: How to call perl script in my django application

2012-06-18 Thread Sergiy Khohlov
>>> from subprocess import call >>> call("uname") Linux 0 >>> call("uname", "-a") 2012/6/18 Carsten Agger : > Den 18-06-2012 13:10, Tanveer Ali Sha skrev: >> >> sorry, i dint get that.Please can u give example .?? >> >> >>  visit this group at http://groups.google.com/group/django-users?h

Re: How to trigger perl scrip in Django

2012-06-19 Thread Sergiy Khohlov
yesterday was a similar question: >>> from subprocess import call >>> call("uname") Linux 0 >>> call("uname", "-a") 2012/6/19 Pervez Mulla : > > > I am Newbie.recently started with django,how to trigger simple Perl script > in django project, > > EX: > small script in perl or bash to do a hell

Re: Django 1.4 Why does the create project command create 2 identical folders

2012-06-26 Thread Sergiy Khohlov
first one name of the project second one name of the application. You had executed both command 2012/6/27 Python_Junkie : > When one creates a project with django-admin.py why is a second my site > folder created? > > Mysite > Mysite > polls > > Thanks in advance. > > What is its function

Re: mysqldb help! Can't connect to MySQL server error...

2012-07-05 Thread Sergiy Khohlov
Could you please connect to mysql from console. Is it OK ? Look like mysql is not started you connect to wrong port connect from network is blocked credentials are wrong 2012/7/5 Tom Evans : > On Thu, Jul 5, 2012 at 1:53 PM, Melvyn Sopacua wrote: >> On 4-7-2012 21:31, Matthew Piatkowski wrote:

Re: mysqldb help! Can't connect to MySQL server error...

2012-07-05 Thread Sergiy Khohlov
WOW ! I forget about date ! Sorry 2012/7/5 Tom Evans : > On Thu, Jul 5, 2012 at 2:59 PM, Sergiy Khohlov wrote: >> Could you please connect to mysql from console. Is it OK ? >> >> Look like >> mysql is not started >> you connect to wrong port &

Re: cleaned_data in forms.py?

2012-07-10 Thread Sergiy Khohlov
Sometimes ago I've added a post to my blog about this: http://skhohlov.blogspot.com/2012/04/passing-values-from-view-to-form.html 2012/7/10 Сергей Фурсов : > You can try to override get_form_kwargs method > > def get_form_kwargs(self, step): > if step == '1' > cleaned_data = self.get_

Re: cleaned_data in forms.py?

2012-07-10 Thread Sergiy Khohlov
its constructor. You shoul use this because parent constructor should be save thanks, Serge (or Sergio for you :-) ) 2012/7/10 Leandro Alves : > Hi Сергей Ф, > > It worked now!!! \o/ > > But I have a question... in this case why do I need to send "None" in > "get_form_kwargs" and why should I u

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread Sergiy Khohlov
problem in view also : def about(request): if request.method == 'POST': return HttpResponseRedirect('/about/') elif request.method == 'GET': return render_to_response('about.html', context_instance=RequestContext(request)) else: raise Http404() this one should

Re: Pls help me to solve this error.

2012-07-13 Thread Sergiy Khohlov
paste your url.py and model.py 2012/7/13 mickey : > I had uploaded image of error. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/4QFMHRLMN58J. >

Re: Why am I getting an error when send e-mail from hosting?

2012-07-16 Thread Sergiy Khohlov
good question contains answer: SMTPDataError: (554, 'mail server permanently rejected message (#5.3.0)') your SMTP reject your message thanks Serge 2012/7/16 Andrejus : > Nicolas, thanks for help. > > I'm glad and proud to state I've discovered the cause of the problem myself > - the prob

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-18 Thread Sergiy Khohlov
Please provide path to your templates 2012/7/19 Ricardo Cardoso : > I'm new to django and python, and decided to follow up the available > tutorials to get up to speed. These were helpful and got me on my feet but > while finishing up the tutorial i hit a major snag. While everything was > workin

Re: Why is my groundwork in django show up in 404 page?

2012-08-24 Thread Sergiy Khohlov
you does not have enabled this in urls.py 2012/8/24 txshon : > I follow the installation steps online about groundwork > > I use the command to setup groundwork for my project > > python manage.py groundwork bookapp Book > > However, I go to the page > > http://127.0.0.1:8000/bookapp/book/l

Re: Not sure how to describe issue/behavior with Form -- so here's code & YouTube video

2012-08-24 Thread Sergiy Khohlov
Hello Barry ! I would like to say that your are not novice. now and your code is really clear. Could you please move string #92 up ? super should be called before other field initialization. look like your prev activity is stored after init process and those data is saved at the save operat

Re: Not sure how to describe issue/behavior with Form -- so here's code & YouTube video

2012-08-25 Thread Sergiy Khohlov
for that matter). > > Thanks, > Barry > > > On Fri, Aug 24, 2012 at 3:00 PM, Sergiy Khohlov wrote: >> >> Hello Barry ! >> I would like to say that your are not novice. now and your code is >> really clear. >> Could you please move string #92 up

Re: ViewDoesNotExist !?!?! It certainly does....

2012-09-11 Thread Sergiy Khohlov
add to urls from tafe.views import session_create 2012/9/12 Lachlan Musicman : > session_create -- 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

Re: Tools - Slow in python django fw

2012-10-01 Thread Sergiy Khohlov
Have you disabled debug in setting.py ? 2012/10/1 Babatunde Akinyanmi : > There are reasons why your app is slow but nobody would be able to > tell you without viewing your sources. You can profile the app and > pinpoint where exactly is slow and ask for advise from the list. > > You can install d

Re: A simple LinkedIn site with django

2012-10-08 Thread Sergiy Khohlov
Hardest task is write to the paper what you want. After this it is possible to prepare information what you want. I have few projects with a similar descriptions. The main problem for all is really simple : project creator can not write to paper (project requirements are better) . As resuk

Re: A simple LinkedIn site with django

2012-10-09 Thread Sergiy Khohlov
In this case I'm proposing to start from simple things. You have saving data from router to the text file ? Perfect. Simple plan: Write a structure of the records Build a django model on it Try to save your data using django model View your data in your browser via django vie and template

Re: How can I integrate simple Custom login page in Django.......?

2012-10-15 Thread Sergiy Khohlov
https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-LOGIN_URL set this one in setting.py 2012/10/15 Pervez Mulla : > Hi, > > I have login.html , login,js ang login.pl. > > I want to integrate basic login page in Django with perl back-end from where > Am reading my DB. > I was trying

Re: How can I integrate simple Custom login page in Django.......?

2012-10-15 Thread Sergiy Khohlov
please provide error message 2012/10/15 Pervez Mulla : > Thank You for your response Sergiy , > > I already try'd to run this script as shown in Django DOC as u given .but > still it didnt work:( > > Thank You > Pervez > > On Mon, Oct 15, 2012 at 1:28 PM, Se

Re: How can I integrate simple Custom login page in Django.......?

2012-10-15 Thread Sergiy Khohlov
please provide error 2012/10/15 Pervez Mulla : > On error note its printing all pelr script itself. > > > On Mon, Oct 15, 2012 at 3:31 PM, Sergiy Khohlov wrote: >> >> please provide error message >> >> 2012/10/15 Pervez Mulla : >> > Thank You for you

Re: display additional information, best practice

2012-10-28 Thread Sergiy Khohlov
Have you tried detailview ? Also it is possible to add some values to the temple in view 2012/10/28 Stefano Tranquillini : > Hi all. > just a question about how to proceed. > when i've to display data direct from the model (the db) one in a page is > simple. > what if i want to display aggregate d

Re: more problems than one

2012-11-09 Thread Sergiy Khohlov
Take a look at your urls.py from django.conf.urls import patterns, include, url from klasse.views import portal, kundendaten urlpatterns = patterns('', (r'^portal1/$', portal1), (r'^kundendaten1/$', kundendaten1) ) this means next : next urls are served : portal1/ and kundendaten1/

Re: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

2012-11-19 Thread Sergiy Khohlov
Which version of django ? Is this one version has python 3.x support ? 2012/11/20 Cj Taylor : > ok, so what needs to happen here? Do I need to recode > /usr/local/lib/python3.2/dist-packages/django/db/backends/mysql/base.py to > use this new module? > > > On Sunday, November 18, 2012 4:57:02 PM

Re: DetailView

2012-11-22 Thread Sergiy Khohlov
I would like to say that this code is really bad : def get_queryset(self): UserModel = get_user_model() pk = self.kwargs['pk'] if not pk: profile = UserModel.objects.filter(pk=self.request.user) else: profile = UserModel.objects.filter(

Re: Seeding Foreign Key with known object with Class Based Views

2012-11-22 Thread Sergiy Khohlov
https://docs.djangoproject.com/en/dev/topics/class-based-views/generic-display/ switch Publisher to client and books to address :-) 2012/11/22 Lee Hinde : > I have two tables, Client and Address. Address has a foreign key 'client' > which points to the client table. I'll make my user enter a

Re: DetailView

2012-11-22 Thread Sergiy Khohlov
Could you please add next string before profile = UserModel.objects.filter(pk=self.kwargs['pk']) print self.kwargs['pk'], type(self.kwargs['pk']) I would like to know something 2012/11/22 David : > Sergiy > > Some of your points cover my old code (which was very much a first draft). > This

Re: DetailView

2012-11-22 Thread Sergiy Khohlov
good news ! pk key is ok , But your database does not contain record for this user. you can do this by manually investigating database or by next code: rom django.core.exceptions import ObjectDoesNotExist try: MyModel = UserModel.objects.get(id=1) except ObjectDoesNotExist: prin

Re: Editing model instance

2012-11-22 Thread Sergiy Khohlov
Have you tried to change instances to your new tables ? 2012/11/22 Sandeep kaur : > I edit value of a table using model instance, however after editing I > want the values to be saved in some other table with same structure. > For this to happen I have used following code in views.py : > > def edi

Re: Editing model instance

2012-11-22 Thread Sergiy Khohlov
you can set values in form via form __init__ 2012/11/22 Sandeep kaur : > On Thu, Nov 22, 2012 at 4:54 PM, Sergiy Khohlov wrote: >> Have you tried to change instances to your new tables ? >> > If I try instance of new table, I won't get the old values

Re: Seeding Foreign Key with known object with Class Based Views

2012-11-24 Thread Sergiy Khohlov
I would like to clarify: 1) you dont need to add client id to the form (this value is already set in your view) 2) If you dont know how to save address let ask Of course please add your code. I can not hack your PC and understand your problem. thanks, Serge 2012/11/24 Lee Hinde : > nt to see

Re: Tutorial Part 3: loading index.html in browser

2012-11-24 Thread Sergiy Khohlov
Near too. simple example of your fitst template: http://www.djangobook.com/en/2.0/chapter04.html remove all after to and place your code inside this 2012/11/25 Luisa Beck : > I'm in the process of going through the Django tutorials. > I'm having trouble with loading the index.html fil

Re: Tutorial Part 3: loading index.html in browser

2012-11-25 Thread Sergiy Khohlov
if latest_poll_list %} > > > > {% for poll in latest_poll_list %} > > {{ poll.question }} > > {% endfor %} > > > > {% else %} > > No polls are available. > > {% endif %} > > > > > > > > > &

Re: Tutorial Part 3: loading index.html in browser

2012-11-25 Thread Sergiy Khohlov
> section. >> The setting.py file in my version of Django only includes TEMPLATE_DEBUG, >> TEMPLATE_LOADERS and TEMPLATE_DIRS. >> >> Could you specify what you mean? Thank you. >> >> On Sunday, November 25, 2012 8:16:00 AM UTC-5, Sergiy Khohlov wrote: >>>

Re: I install v1.5 Django, and run a my first site, then have an error: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte. I use Sublime editor.

2012-11-25 Thread Sergiy Khohlov
check databse setting. look like your database uses non utf8 encoding 2012/11/25 Julien Phalip : > Hi, > > Can you please post the entire traceback? > > Thanks! > > Julien > > > On Sunday, November 25, 2012 4:03:11 PM UTC+1, 名宏贾 wrote: >> >> I don't know why, editer have default utf-8 setting. >

Re: Seeding Foreign Key with known object with Class Based Views

2012-11-26 Thread Sergiy Khohlov
jango from brain only :-) newaddress.client_id = self.client_data.id # now we are ready to save new address newaddress.save() return http.HttpResponseRedirect(self.get_success_url()) 2012/11/25 Lee Hinde : > > On Nov 24, 2012, at 2:41 PM, Sergiy Khohlov wro

Re: how to auto-populate(auto-update) model's field(s) via custom button or on Save

2012-11-26 Thread Sergiy Khohlov
>>> import httplib >>> myhost = httplib.HTTPConnection('www.google.com') >>> myhost.request("GET") >>> googleanswer = myhost.getresponse() >>> print googleanswer.read() 302 Moved 302 Moved The document has moved http://www.google.com.ua/";>here. >>> Need more ? 2012/11/25 Andriyko : > Hello

Re: how to auto-populate(auto-update) model's field(s) via custom button or on Save

2012-11-26 Thread Sergiy Khohlov
= urlclass.objects.get(url=url), myitem=item) item.save() or something like that :-) 2012/11/26 Andriyko : > The problem is not how to fetch, but how to save. > > On Monday, November 26, 2012 2:37:31 PM UTC+2, Sergiy Khohlov wrote: >> >> >>> import httplib >> >>> my

Re: Templates not found

2012-12-11 Thread Sergiy Khohlov
take a look you have error related to myproject.view.home but importing track.view.home 2012/12/11 Sithembewena Lloyd Dube : > > > On Tue, Dec 11, 2012 at 4:36 AM, Sithembewena Lloyd Dube > wrote: >> >> Hi all, >> >> I have a Django project running Django 1.4.1. (just upgraded). My >> TEM

Re: Templates not found

2012-12-11 Thread Sergiy Khohlov
please paste your urls.py 2012/12/11 Sithembewena Lloyd Dube : > Hi Segiy, > > Thanks for the response. "myproject" is only an alias I used while posting > the code on here, in the project code it is actually "tracks". > > > On Tue, Dec 11, 2012 at 1:3

Re: Foreignkey Form

2012-12-12 Thread Sergiy Khohlov
1) you should create a form for building 2) you should create a form for inhabitant and set key to the correct value before saving IMHO simple way is create a edit form for buiding which has buttons add/remove inhabitant . check DetailView in docs please thanks, Serge skype: skhohlov te

Re: Foreignkey Form

2012-12-12 Thread Sergiy Khohlov
https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-display/#detailview Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/12 Jonas Geiregat : > Thanks for the response Serge, > > So basically I was on the right path. > > But I don't see what the DetailView has to do wit

Re: Templates not found

2012-12-12 Thread Sergiy Khohlov
dmindocs.urls')), > > # Uncomment the next line to enable the admin: > url(r'^admin/', include(admin.site.urls)), > ) > > I even considered indentation problems, but I have checked that and it is > fine. > > > > On Tue, Dec 11, 2012 at 5:53 PM,

Re: Implementing a monitoring system with django.

2012-12-17 Thread Sergiy Khohlov
"Pro python system administration" by Rytis Sileika published by Apress covers this area. Jinja2 is used for generating templates. You also can use django for this task. Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/17 Ryan Nowakowski : > Checkout Graphite[1]. It seems like i

Re: Entity has an event Lifecycle, how does Django do it?

2012-12-19 Thread Sergiy Khohlov
Have you checked https://docs.djangoproject.com/en/dev/topics/auth/ ? Allso views and forms for this one are already created Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/19 Glyn Jackson : > In other languages and frameworks I have used when you have an entity such > as user. Ea

Re: Very Odd Query problem

2012-12-25 Thread Sergiy Khohlov
please provide next output from mysql select * from view_usercontactemail where id in (2,3) Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/23 Gerald Klein : > Hi all, I have a custom model mapped to a view, a join between a UserContact > model which carries contacts for users and

Re: Django output time is 8 hours ahead of database time

2012-12-28 Thread Sergiy Khohlov
Could you please provide timezone from your local system ? Pacific time ? or UTC ? Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/29 Jeff Hsu : > I'm very new to Django and I've been learning the framework from the book > "Practical django Projects" (the book teaches us to write a

Re: How to get self.id when saving a new object?

2013-01-09 Thread Sergiy Khohlov
I have no idea why you decided to investigate a bicycle... Please separate task in two simple : 1) for editing object use url ///edit 2) for creating new object //new Take a look at generic view. Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/9 Tom Evans : > On Wed, Jan 9,

Re: Looking for a Senior Django Application Developer

2013-01-09 Thread Sergiy Khohlov
Please add comment that this position for US citizen only. Looks like this position is not World Wide Many thanks, Serge 2013/1/9 Andy : > All, > > Sorry to bug the group with an open position - but thought it was worth a > try. > > I am looking for a senior Django application developer for

Re: How to get self.id when saving a new object?

2013-01-09 Thread Sergiy Khohlov
mentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: # url(r'^admin/', include(admin.site.urls)), ) You should create two templates only it is not hard. I think that form usage is over the

Re: how can i toggle django boolean field automatically

2013-01-10 Thread Sergiy Khohlov
Model has ability to set default value to the field. https://docs.djangoproject.com/en/dev/ref/models/fields/#editable If you would like to set values on runtime please set those value in to form constructor. Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/10 Okorie Emmanuel : > hi

Re: What's your opinion about nested apps?

2013-01-11 Thread Sergiy Khohlov
keep in mind comas INSTALLED_APPS = ( 'incidences', 'problems', ) 2013/1/11 David Medina : > INSTALLED_APPS = ( > 'trouble_ticketer', > 'trouble_ticketer.incidences' > 'trouble_ticketer.problems' > ) Many thanks, Serge +380 636150445 skype: skhohlov -- You received th

Re: Getting a no such column error when adding data and syncdb is not syncing

2013-01-18 Thread Sergiy Khohlov
python manage.py syncdb Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/18 Nick : > This is my first django project outside of the tutorials and it's > frustrating to stumble over something so simple. > > I'm getting this error when I try to add a product: >> >> DatabaseError at /adm

Re: Generic views and url issues

2013-01-23 Thread Sergiy Khohlov
try to check testaddcall/1/ please Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/24 : > I've been trying to understand how to use generic views. I've followed some > tutorials, and read through Django docs, but I can't get the url function to > work in my templates. > > I get the

Re: initial argument in forms not working for me

2013-01-28 Thread Sergiy Khohlov
I'm using dynamic initialization for this case . I've written a post in my blog about this long time ago : http://skhohlov.blogspot.com/2012/04/passing-values-from-view-to-form.html Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/28 Nikhil Verma : > Sorry I made a typo in last email

Re: plz help me for error in python for django.....

2013-02-06 Thread Sergiy Khohlov
1) please provide your model Poll 2) are you run syncdb ? Many thanks, Serge +380 636150445 skype: skhohlov 2013/2/6 Avnesh Shakya : > > Here i want to explore database API but it's generating error.. > C:\mysite>python manage.py shell > Python 2.7.3 (default, Apr 10 2012, 23:31:26) [M

Re: how to password will come in hidden form in django?

2013-02-14 Thread Sergiy Khohlov
Gave you checked django-auth befor start ? This module has all for you. You should not code code which is already coded :-) Many thanks, Serge +380 636150445 skype: skhohlov On Fri, Feb 15, 2013 at 8:11 AM, Avnesh Shakya wrote: > i have created my Userinfo model for registration, but pas

Re: please help me,how to create registration model

2013-02-14 Thread Sergiy Khohlov
Take a look at the examples https://docs.djangoproject.com/en/dev/topics/auth/default/ Many thanks, Serge +380 636150445 skype: skhohlov On Fri, Feb 15, 2013 at 7:23 AM, Avnesh Shakya wrote: > please help me,i m beginner i m creating my registration model but how can > i write password field

Re: please help me,how to create registration model

2013-02-14 Thread Sergiy Khohlov
i have created a registration.html form. now i > want to store these things through its page.. so how can i do? i m nervous > because i m beginner.. plz tell me ... if any site is available for it plz > suggest me... > > > On Fri, Feb 15, 2013 at 11:49 AM, Sergiy Khohlov wrote: > >

Re: understand the run_validators function.

2013-02-21 Thread Sergiy Khohlov
form is valid if all field pass validator Many thanks, Serge +380 636150445 skype: skhohlov On Thu, Feb 21, 2013 at 2:30 PM, ANKIT BAGARIA wrote: > i am not able to understand the code of run_validators() function in > fields.py file under forms folder. Someone please help. > > -- > You rece

Re: os.system() is not working in django while working on server centos

2013-03-01 Thread Sergiy Khohlov
take a look https://docs.djangoproject.com/en/dev/topics/logging/ using paramiko inside views ... I would like to say that you know a meaning of the sex :-) Many thanks, Serge +380 636150445 skype: skhohlov On Fri, Mar 1, 2013 at 4:26 PM, JAI PRAKASH SINGH < jaiprakashsingh...@gmail.com> w

Re: Need Advice: Sending Emails

2013-04-11 Thread Sergiy Khohlov
this is expected behavior. SMTP server should blocks attempt to send email from nonauth client. In other case it is open relay. Many thanks, Serge +380 636150445 skype: skhohlov On Thu, Apr 11, 2013 at 9:37 PM, Venkatraman S wrote: > > Am sure many in this mailing list are running website

Re: Need Advice: Sending Emails

2013-04-11 Thread Sergiy Khohlov
cesses. > > > On Fri, Apr 12, 2013 at 11:11 AM, Sergiy Khohlov wrote: > >> this is expected behavior. >> SMTP server should blocks attempt to send email from nonauth client. In >> other case it is open relay. >> >> Many thanks, >> >> Serge >>

Re: Admin list object, display fields from a fk object

2013-05-07 Thread Sergiy Khohlov
this not hard : from django.db import models # Create your models here. class A(models.Model): """ model A """ name_a = models.CharField(max_length=20) def __unicode__(self): return self.name_a class B(models.Model): """ Model B""" keyfield = models.Foreign

Re: Admin list object, display fields from a fk object

2013-05-07 Thread Sergiy Khohlov
om> wrote: > Thank you for your answer, that i managed to achive, > what I want is to display on the admin object list of object B, display > name_B and name_A > > Anyway > Thanks > Alex > > > Terça-feira, 7 de Maio de 2013 13:43:59 UTC+1, Sergiy Kho

Re: problem setting up DJANGO Database MySQL, library MySQL-python seemed installed

2013-05-13 Thread Sergiy Khohlov
have you used virtenviroment ? could you please check a python version ? Many thanks, Serge +380 636150445 skype: skhohlov On Fri, May 10, 2013 at 1:25 AM, wrote: > Unable to setup MySQL on CentOS5.9 for DJango > > raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) > d

Re: Get id from url

2013-05-13 Thread Sergiy Khohlov
check this one : https://docs.djangoproject.com/en/dev/topics/http/urls/ looks like url(r'^test/upload/\(d{8})/$', 'mymodule.views.pass_id'), and function mymodule.views.pass_id (request, passed_id) Many thanks, Serge +380 636150445 skype: skhohlov On Mon, May 13, 2013 at 10:01 PM, Hélio

Re: Pls help me

2013-05-14 Thread Sergiy Khohlov
Could you please clarify your question ? What do you want to do ? I dont have mind control skill Many thanks, Serge +380 636150445 skype: skhohlov On Tue, May 14, 2013 at 10:33 AM, Nathaniel wrote: > Hi guys. What is wrong with my codes below? > > class EmailChangeForm(forms.ModelForm): >

Re: Pls help me

2013-05-14 Thread Sergiy Khohlov
Post your models, views, forms and sometimes a template Many thanks, Serge +380 636150445 skype: skhohlov On Tue, May 14, 2013 at 11:18 AM, Nathaniel wrote: > Hi. Upon login, user can go to email_change_form.html to update their > email address. They will enter their new email twice to updat

Re: Reg: Delete Button is not removing the entry

2013-05-14 Thread Sergiy Khohlov
few coins from me. I hope you are passing object id correctly to your function delete. object which is should be deleted is obj = self.table.get_object_by_id(obj_id) but you can try to delete via : cinder.volume_delete(request, obj_id) possible simple way is write something like : obj.d

Re: @method_decorator(login_required) but how to add "login_url=''login/" to login_required

2013-05-25 Thread Sergiy Khohlov
you can set it in setting.py file Many thanks, Serge +380 636150445 skype: skhohlov On Sat, May 25, 2013 at 9:33 AM, nany wrote: > @method_decorator(login_required) but how to add "login_url=''/login/" to > login_required > > in function view, I use @login_required(login_url='login/') but i

Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Sergiy Khohlov
Big job is started ! Big congrat from me ! Many thanks, Serge +380 636150445 skype: skhohlov On Tue, May 28, 2013 at 9:17 AM, Kevin wrote: > A small update, I just completed the first chapter and laid out the rest > of the chapters which will be made available. You can view the current

Re: django , python and ides

2013-06-02 Thread Sergiy Khohlov
emacs + few plugin. For me it is a better choise Many thanks, Serge On Sun, Jun 2, 2013 at 12:01 AM, Doug Snyder wrote: > Hey I just ran into a new opensource Python IDE that looks interesting > that wasn't around when I commited to Aptana > Ninja-ide > http://www.ninja-ide.org/ > review at:

Re: Writing your first Django app - Tutorial Question

2013-06-05 Thread Sergiy Khohlov
you have missed from django.utils import timezone Also simple question : How are you adding this nice code formatting ? Many thanks, Serge +380 636150445 skype: skhohlov On Wed, Jun 5, 2013 at 7:48 AM, Mike Dewhirst wrote: > On 5/06/2013 9:10am, Tony Guilin wrote: > >> In the >> ht

Re: pattern validation in QueryDict.get()

2013-06-05 Thread Sergiy Khohlov
I have not seen any problem with this one >>> myurl = re.compile('\d{0,5}') >>> print myurl.match("1235") <_sre.SRE_Match object at 0xb73e0758> >>> print myurl.match("12356789") <_sre.SRE_Match object at 0xb73e0758> >>> print myurl.match("1235").group() 1235 >>> print myurl.match("12356789").group(

Re: Understanding an existing big web application written in Django

2013-06-05 Thread Sergiy Khohlov
What is mean big application ? 1) Write an idea 2) Write a plan 3) Write requirements 4) Rewrite all above few times and you are PM and developer now. Many thanks, Serge +380 636150445 skype: skhohlov On Thu, Jun 6, 2013 at 5:17 AM, Siddharth Shah wrote: > I think you can definitely lear

Re: On live site, DatabaseError tables not found; dbshell shows tables but apache can't find the database?

2013-06-08 Thread Sergiy Khohlov
looks like you are using other settings.py for .wsgi connection Many thanks, Serge +380 636150445 skype: skhohlov On Sat, Jun 8, 2013 at 7:44 AM, Brian Lee wrote: > I'm trying to set up an existing project on a new hosting provider > (webfaction). The site is up and running, except for any

Re: Django Simple registration fourm

2013-06-13 Thread Sergiy Khohlov
Hello, "Use the Force, Luke!" in "Star Wars" :-) https://github.com/django/django/blob/master/django/contrib/auth/forms.py You can create your user creating form using UserCreationForm as parent Thanks, Serj +380 636150445 skype: skhohlov On Thu, Jun 13, 2013 at 4:30 PM, Muhammad Bil

Re: data format value changes in database

2013-06-16 Thread Sergiy Khohlov
looks like you have a problem with a form : datafield support 2 formats, but datainput only one Many thanks, Serge +380 636150445 skype: skhohlov On Sat, Jun 15, 2013 at 2:29 PM, wrote: > view.py > > def when(request): > > if not report.manual_date: > report.manua

Re: Problem when creating a form for adding users to groups

2013-06-18 Thread Sergiy Khohlov
Which one error ? Many thanks, Serge +380 636150445 skype: skhohlov On Tue, Jun 18, 2013 at 1:56 PM, Lucas Lins wrote: > Hi. > I ran into a problem and have searched the group, in the official django > and the internet and could not solve the problem. > I created a form that lists all the

Re: looking for an apache/system admin master

2013-06-18 Thread Sergiy Khohlov
Hello, If you know this IP you can block it using firewall rules. It is possible to reject this traffic and next time attacker be blocked by router not you host. In this case stop traffic as early as possible is not bad strategy. Many thanks, Serge +380 636150445 skype: skhohlov On

Re: Question about python for web

2013-06-24 Thread Sergiy Khohlov
check permission by chmod and verify that handler is correct Many thanks, Serge +380 636150445 skype: skhohlov On Mon, Jun 24, 2013 at 4:07 AM, Dat Huynh wrote: > Dear all, > > I have a very simple question about running a simple web application with > apache on MacOS. > > Step 1: Copy th

  1   2   3   >