ModelForm unbound

2011-04-21 Thread Constantine
Hi i've used some logic in clean_field methods, but when i've migrated to ModelForm, was very surprised that clean methods does not invoked after some investigation i realized that model instane does not makes modelform bound automatically i'm expect that model validation also triggered as pointe

Re: ModelForm unbound

2011-04-21 Thread Constantine
about DRY? > which presumably are already valid, > otherwise they should not have been saved db essentials could be invalid if there hard validation logic exists On Apr 21, 7:35 pm, Daniel Roseman wrote: > On Thursday, April 21, 2011 8:16:36 AM UTC+1, Constantine wrote: > > > Hi &g

Request and null value

2011-06-05 Thread Constantine
Hi, a have a problem, but may be this is expected behaviour: on client side i'm post: $.post("my url",{myvar:null}...) but on server side: request.POST becomes {myvar:u'null'} null deserialized to string. So, do i need to report a bug in tracker? -- You received this message because you are su

Re: Request and null value

2011-06-06 Thread Constantine
Thanks, i've workaround this with empty string. I was surprised when saw raw_post_data which looks very similar to GET string. I confused this behaviour with JSON parser. On 6 июн, 12:50, Jani Tiainen wrote: > On Sun, 2011-06-05 at 22:36 -0700, Constantine wrote: > > Hi, a have

ModelForm save call with data and instance

2011-07-04 Thread Constantine
def view(request) form = MyForm(request.POST, instance = MyModel(myfiled = 1)) if form.is_valid(): obj = form.save() but POST will NEVER merged with instance i've looked through stack: ModelForm's save() https://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L

Re: ModelForm save call with data and instance

2011-07-05 Thread Constantine Linnick
I Found problem, it was triple collision: pycharm debugging sideeffect, wrong inheritance in _init_, but most destructive was form fields: it overwrites instance values with None. (if someone find this post from search anyway, thanks for reply -- You received this message because you are subsc

Re: How do I do a multiple select in the Admin filters ?

2016-07-25 Thread Constantine Covtushenko
Hi Hurlu, I can suggest two approaches here. 1. change your model so that it contains two fields: 'allowed' and 'disallowed'. Every of which is an array of allowed and disallowed items respectively. You can use JSON Field for that. This approach has benefit that your models looks s

Re: Django MySql weirdness

2016-07-25 Thread Constantine Covtushenko
Hi Steve, Can you please provide code snippet here for 'action_time' field? Regards, On Mon, Jul 25, 2016 at 9:11 PM, Steve Bischoff wrote: > > > http://stackoverflow.com/questions/38534734/django-42000-invalid-default-value-for-action-time > > I have been trying to figure this one out for a b

Re: Any way to force Django to commit a write so another process can read the correct data from DB?

2016-07-27 Thread Constantine Covtushenko
Hi Stodge, As said in Django current version of documentation , 'post_delete' signal is sent after record is deleted. This means also that transaction is closed at that moment. And DB should not has deleted instance any more. I have

Re: How to add logo to django header

2016-07-28 Thread Constantine Covtushenko
Hi Gauri, One of approach is would be to override admin base template used as a parent for all admin pages. Please see that documentation link about how to do that. Regards, On Thu, Jul 28, 2016 at 9:04 AM, Gau

Re: Any way to force Django to commit a write so another process can read the correct data from DB?

2016-07-28 Thread Constantine Covtushenko
Hi Mike, It is not a bug. It is just how it works. Regards On Thu, Jul 28, 2016 at 3:53 AM, Mike Dewhirst wrote: > On 28/07/2016 5:46 AM, Constantine Covtushenko wrote: > >> Hi Stodge, >> >> As said in Django current version of documentation >> <https://

Re: Query annotation with date difference

2016-07-31 Thread Constantine Covtushenko
Hi Yoann, I am not sure exactly but believes you are on the right way. Try improve your expression with ExpressionWrapper, as said here . Probably the problem is that you use values of different types in your

Re: Search multiple fields in Django Models

2016-08-01 Thread Constantine Covtushenko
Hi Jurgens, Django is the right choice. With Django all are possible. All that you described are possible. If you need more precise answer give us more precise question. Regards, On Mon, Aug 1, 2016 at 4:21 PM, Jurgens de Bruin wrote: > Hi, > > I am new to Django, I have been using TurboGears

Re: Query annotation with date difference

2016-08-01 Thread Constantine Covtushenko
the dict method and work with the dictionary instead, so that I > can add custom fields more easily. > > Yoann > > > > Le dimanche 31 juillet 2016 09:25:58 UTC+2, Constantine Covtushenko a > écrit : >> >> Hi Yoann, >> >> I am not sure exactly but bel

Re: cookiecutter-django installation

2016-08-01 Thread Constantine Covtushenko
Hi Gary, It is not clear what errors you have gotten. Can you please describe them? I am not using Eclipse any more so can not reproduce you problem by my own. But all should be run without problem On Mon, Aug 1, 2016 at 11:14 PM, Gary Roach wrote: > I am having trouble with a cookiecutter-dja

Re: Query annotation with date difference

2016-08-02 Thread Constantine Covtushenko
_date') - timezone.now())/models.F('interval'), models.DateTimeField())) As we can see no dates format problem at all. Django works as expected - perfectly! Hope that helps. Regards, On Tue, Aug 2, 2016 at 8:35 AM, Constantine Covtushenko < constantine.covtushe...@gmail.com&

Re: cookiecutter-django installation

2016-08-02 Thread Constantine Covtushenko
PM, Constantine Covtushenko wrote: > Hi Constantine > > I guess I didn't make my self clear. I have not installed > cookiecutter-debian because I haven't figured out how to do that with my > setup. There are no errors because there is no installation., > > Gary Rl >

Re: Accessing session in Django models?

2016-08-03 Thread Constantine Covtushenko
Hi Neto, As said in Documentation of 'limit_choices_to' value for this key should be: `Either a dictionary, a Q object, or a callable returning a dictionary or Q object can be used.` For your c

Re: How do templates automatically convert dates to local timezone?

2016-08-03 Thread Constantine Covtushenko
Hi Robert, You have touched a very simple but always confusing questions - storing dates and showing them to users in different places. As I know Django uses that in very straightforward way. It always converts dates to UTC. Flow that converts them back to different users in different time-zones

Re: Query annotation with date difference

2016-08-03 Thread Constantine Covtushenko
Sorry, I did not specify. I have been using 'Postgresql' with 'psycopg2 v.2.6.2'. They gave me those results. Also here is a sql query given from log: SELECT "test_app_entity"."id", "test_app_entity"."due_date", "test_app_entity"."interval", (("test_app_entity"."due_date" - '2016-08-03T21:31:58.32

Re: QuerySet for related models

2016-08-04 Thread Constantine Covtushenko
Hi M Hashmi, As I see your model scheme built with meaning that 1 record of HitCount relates to many records of Product. And in your queries you try to select all products that relate to 5 topmost HitCounts. Am I correct? Will be waiting for your response. On Thu, Aug 4, 2016 at 6:41 PM, M Has

Re: QuerySet for related models

2016-08-04 Thread Constantine Covtushenko
Please check my notes below: On Thu, Aug 4, 2016 at 10:42 PM, M Hashmi wrote: > My field hits=models.ForeignKey(Hitcount) means that my Product model has > a related model with multiple fields and all the products in Product model > will have one or more hit records. > Sorry but I do not see ho

Re: QuerySet for related models

2016-08-04 Thread Constantine Covtushenko
Hi M Hashmi, I believe that you are looking a way to use aggregation on related model. You should try the following snitppet: `trending_products = Product.objects.aggregate(hit=Max('hits__hits'))[:6]` (see more info here ) This will gi

Re: AttributeError overriding save_existing_objects in Formset class

2016-08-09 Thread Constantine Covtushenko
Hi Vincenzo, Can you please specify Django version that you are using. Regards, On Tue, Aug 9, 2016 at 6:06 PM, Vincenzo wrote: > Hi there, > I'm using the admin and I have a form admin and an inline admin form. For > this inline admin, I need to ignore modifications done for existing items:

Re: AttributeError overriding save_existing_objects in Formset class

2016-08-10 Thread Constantine Covtushenko
ngo version I'm using is the 1.9.4 > > Il giorno martedì 9 agosto 2016 22:04:57 UTC+2, Constantine Covtushenko ha > scritto: >> >> Hi Vincenzo, >> >> Can you please specify Django version that you are using. >> >> Regards, >> >> On Tue, Aug 9,

Re: Crispy forms and its "coercing to unicode need string or buffer nonetype found"

2016-08-11 Thread Constantine Covtushenko
Hi Rompe, >From you have posted I can suggest check your model. Can you post here code of it? Regards, On Thu, Aug 11, 2016 at 1:11 PM, RompePC wrote: > I was working on an admin panel, and when I try to get to the add/update > view of the model, it just throws this error. I've been checking G

Re: Parent initialization don't working

2016-08-11 Thread Constantine Covtushenko
Hi Rompe, As for your admin models it seems like they should extend: `admin.ModelAdmin`, see django documentation I am not sure that this is a problem you have encountered. But to move further please do like said in the documentation fir

Re: Trying to use Django 1.9.5, django_pyodbc, MS SQL Server 2012 on 64bit Windows 7

2016-08-11 Thread Constantine Covtushenko
Great job done. You welcome! Regards, On Thu, Aug 11, 2016 at 8:46 PM, Evan Roberts wrote: > > Thanks for the help and guidance. I found a solution. I installed these > libs and was able to connect: > Django (1.9.9) > django-pyodbc-azure (1.9.9.0) > pip (8.1.2) > pyodbc (3.0.10) > > I connect

Re: Crispy forms and its "coercing to unicode need string or buffer nonetype found"

2016-08-12 Thread Constantine Covtushenko
Hi, Sounds great. On Fri, Aug 12, 2016 at 11:12 AM, RompePC wrote: > Ok, I just did again a *unicode(..)* call to a method that before worked > without it. Sincerely, I just have no idea why now I need to do it. > > Solved. > > > El jueves, 11 de agosto de 2016, 12:58:20 (UTC+2), RompePC escrib

Re: ProgrammingError: (2014, "Commands out of sync; you can't run this command now")

2016-08-12 Thread Constantine Covtushenko
Hi Anoop, I've checked that such kind of errors comes from MySQL server. You can check detailed explanation here . Do you have any procedure run on your server? On Fri, Aug 12, 2016 at 11:37 AM, ANOOP M.S wrote: > any idea why th

Re: Parent initialization don't working

2016-08-12 Thread Constantine Covtushenko
Sorry, I did not mention your point about xadmin. Sorry again. I've checked its github page. It seems like they do not have documentation in English. So may be your problem should be addressed to them? Did you try that? Else as for me we should go to xadmin code and check there. On Fri, Aug 12,

Re: DoesNotExist on ForeignKey Access

2016-08-12 Thread Constantine Covtushenko
HI guis, I need to mention one point that works well for me. If you check blob existence with: hasattr(widget, 'blob') then django responds False in the case Blob Does Not exist an True otherwise. At the same time DB request is performed but DoesNotExist exception is not raised. On Fri, Aug 12

Re: TemplateSyntaxError when using inbuilt views

2016-08-13 Thread Constantine Covtushenko
Hi Piyush, Welcome to community! Can you please give us your template snipped? Regards, On Sat, Aug 13, 2016 at 6:48 AM, Piyush Rungta wrote: > Hello this is my first time here. > So I am trying to create directory index to serve static files uploaded by > users by using inbuilt view by addi

Re: Help with django form an ajax, error 500

2016-08-17 Thread Constantine Covtushenko
Hi Andrew, To have a proper `to_python` transformation from `POST` strings please use forms. They do that perfectly and also they can handle any king of user input validations. form = SomeCustomForm(request.POST) form.is_valid(): parsed_dictionary = form.cleaned_data() As for 'Ajax'. It seem

Re: Help with django form an ajax, error 500

2016-08-17 Thread Constantine Covtushenko
/http/request/#HttpRequest.is_ajax>` method to detect such requests. That can be done import json if request.is_ajax(): query_dict = json.loads(request.body) I hope it helps. Regards, Constantine C. On Thursday, August 18, 2016 at 4:34:33 AM UTC+3, agapito treviño wrote: > > Elros Romeo

Re: Django query not returning all objects

2016-08-17 Thread Constantine Covtushenko
Hi Koonal, As said in django doc you can use `distinct()` to remove duplicated rows from first query. I believe with this your pagination should works as expected. Regards, On Thu, Aug 18, 2016 at 2:58 AM, Koonal Bharadwaj

Re: Django query not returning all objects

2016-08-19 Thread Constantine Covtushenko
4, Todor Velichkov a écrit : >> >> Another solution would be to annotate min/max deadline date and order by >> the annotation. Something like: >> >> cases = HeartFlowCase.objects.all().annotate(min_deadline=Min('data_ >> _deadline')).order_by('min_

Re: Custom Template Tag

2016-09-01 Thread Constantine Covtushenko
Hi All, There is no valuable reason to do it in the template. And no matter how to ate using it, cause template should only present view model(s). But if you tell us your intention may be we can suggest a better place for such request? Regards, On Sep 2, 2016 6:03 AM, "Al Johri" wrote: > Ludov

Re: Abridged summary of django-users@googlegroups.com - 35 updates in 12 topics

2016-09-14 Thread Constantine Covtushenko
Hi Juliana, Did check this django doc page? It describes basics of how to work with files. The same stands for images. Also you can check one of the available extensions. I was using django-filer.

Re: download file when debug=false

2016-09-30 Thread Constantine Covtushenko
Hi Richard, There are a lot of options of how to change/switch application behaviour. It depends on what you eventually need to get. Mentioned solution: settings.DEBUG = true/false can be one of them Hope it helps. Regards, Constantine C. > On Sep 30, 2016, at 12:06, Richard Ausc

Re: download file when debug=false

2016-10-01 Thread Constantine Covtushenko
Hi Richard, Ah, I missed your point last time. Sorry for that. Can you please print here code sniped with with your app returns excel file? It helps us to suggest something valuable. Regards, > On Sep 30, 2016, at 12:06, Richard Auscard wrote: > > hello, > > i have developp a django applicat

Re: Django app crashes with out of memory

2016-10-10 Thread Constantine Covtushenko
Hi Dmitry, Please check that documentation page . As you can see iterator() loads all in the memory and after that returns an iterator. Try to fetch records say by 50 - 100 items. Hope that helps. On Mon, Oct 10, 2016 at 2:1

Re: NoReverseMatch Error using Django + Haystack + Elasticsearch

2016-10-15 Thread Constantine Covtushenko
, Constantine C. On Sat, Oct 15, 2016 at 12:48 AM, Aline C. R. Souza wrote: > Hello everybody, > > I am having a issue using Django + Haystack + Elasticsearch to perform a > website search. > > I made a question on StackOverflow, but I had no satisfatory answer. > > The problem

Re: Dynamic choice option for select filed in Multivaluefield

2016-10-15 Thread Constantine Covtushenko
Hi Saranya, Please try in TestForm > self.fields['t'].fields[1].widget.choices = ((1,1),) Hope it helps On Fri, Oct 14, 2016 at 9:31 AM, saranya k wrote: > I want to set choices for ChoiceField in MultiValueField in form init. But > its not getting updated. > class TestField(forms.MultiValueF

Re: HELP - Django variable in style (width) attribute

2016-10-15 Thread Constantine Covtushenko
Hi Aline, It is not direct answer for what you are asking, but why do you calculate the percentage 2 times? Why just use `with <https://docs.djangoproject.com/en/1.10/ref/templates/builtins/#with>` tag? With it nor problem at all. Hope that helps. Regards, Constantine C. On Sun, Oct 16

Re: Deploy on Heroku Error

2016-10-21 Thread Constantine Covtushenko
ild-your-app-and-run-it-locally> article. Using `heroku local` command helps fix/run/check locally and after all ok you safely commit and push to heroku. Hope that helps Regards, Constantine C. On Fri, Oct 21, 2016 at 8:39 AM, Antonis Christofides < anto...@djangodeployment.com> wro

Re: Deploy on Heroku Error

2016-10-21 Thread Constantine Covtushenko
? Regards, Constantine C. On Fri, Oct 21, 2016 at 1:14 PM, Aline C. R. Souza wrote: > Hello, Constantine, > > I have already followed this article and using `heroku local` the app runs > fine. However, some things I did different: > > (i) I used psycopg2==2.6.2 instead of psycopg2==

Re: Admin Email From Address

2016-11-14 Thread Constantine Covtushenko
Hi Matthew, There should be considered following: 1. Not always cod runs with user interaction - worker cases 2. Not always user authenticated With such cases who the sender should be? Regards, Constantine C. On Nov 15, 2016 12:43 AM, "Matthew Pava" wrote: I would like to be able

Re: Admin Email From Address

2016-11-15 Thread Constantine Covtushenko
we would have a fallback that is already established in the > settings file. > > > > *From:* django-users@googlegroups.com [mailto:django-users@ > googlegroups.com] *On Behalf Of *Constantine Covtushenko > *Sent:* Tuesday, November 15, 2016 12:46 AM > *To:* django-users@googl

Re: Admin Email From Address

2016-11-15 Thread Constantine Covtushenko
> > *From:* kostyak7...@gmail.com [mailto:kostyak7...@gmail.com] *On Behalf > Of *Constantine Covtushenko > *Sent:* Tuesday, November 15, 2016 2:27 PM > > *To:* django-users@googlegroups.com > *Subject:* Re: Admin Email From Address > > > > Sorry but I do not see any

Re: Serving external files with Django

2017-01-02 Thread Constantine Covtushenko
Hi Priyesh, You can start from managing files documentation of Django. Hope that helps On Mon, Jan 2, 2017 at 6:16 PM, Priyesh Raj wrote: > Hi, > > I need to serve content of external files on user action (Click on URL). > The files are PD

Re: Django search

2017-01-15 Thread Constantine Covtushenko
Hi Branco, Sorry, but can you be more specific? If you've got the result what is your concern? Do you only need to switch into forms? Regards, Constantine C. On Sun, Jan 15, 2017 at 2:41 PM, Branko Zivanovic < international11...@gmail.com> wrote: > How do i implement search on

Re: Heroku push failed

2017-02-05 Thread Constantine Covtushenko
Hi Jonathan, Sorry for stupid question but you did not specify that exactly. Did you add that module in requirements.txt or requirements.pip? Can you double check that? On Sun, Feb 5, 2017 at 2:54 PM, Jonathan Cheng wrote: > In Win10 > when i run "git push heroku master" > the traceback showed:

Re: Djnago User login

2017-03-01 Thread Constantine Covtushenko
Hi Hossein, I am not sure that understood you correctly. Are you asking about the way how to handle two types of authentication? One by user name and password, an other by just username? On Wed, Mar 1, 2017 at 4:05 PM, Hossein Torabi wrote: > is there any method that i have two kind of users

Re: Djnago User login

2017-03-01 Thread Constantine Covtushenko
+1 for CustomAuth Backend solution. In runtime Django checks all set backends in the order so I would suggest to put your backend at the beginning of backend's list. On Thu, Mar 2, 2017 at 12:05 AM, Shawn Milochik wrote: > It takes a little fiddling, but you can log in a user however you want.

Re: "In menu" does not work - Can anybody help?

2017-05-10 Thread Constantine Covtushenko
Hi Lisa, Can you please tell what application do you use for that? Is it django-cms? Regards, Constantine C. On Wed, May 10, 2017 at 10:28 AM, wrote: > Hi there, > I have a problem with the "in menu" section of a child-page in django. The > URL is www.tenag.de/arbeitshilf

Re: Permissions for Anonymous Users in Django

2017-05-10 Thread Constantine Covtushenko
Hi Uzair, Can you please provide some use cases when there is needed such behavior? Regards, Constantine C. On Tue, May 9, 2017 at 6:56 AM, Uzair Tariq wrote: > Does the Django have support for permission for the anonymous users? Reference > Topic Link > <https://docs.djangopr

Re: "In menu" does not work - Can anybody help?

2017-05-11 Thread Constantine Covtushenko
I am not a huge expert of django-cms. I just got it in 1 project of mine. And I ca say that all works as expected. It is difficult to describe what is wrong with your menu based on what you provided. May be you can bring some sort of screenshots here? Regards, Constantine C. On Thu, May 11

Re: Permissions for Anonymous Users in Django

2017-05-11 Thread Constantine Covtushenko
gic. I believe that you should write your own Authentication Backend to allow what you need for Anonymous user cases. Hope that helps. Regards, Constantine C. On Thu, May 11, 2017 at 12:24 AM, Melvyn Sopacua wrote: > On Wednesday 10 May 2017 09:49:48 Uzair Tariq wrote: > > > Cons

Re: Permissions for Anonymous Users in Django

2017-05-11 Thread Constantine Covtushenko
Hi Uzair, Please find my answer in blue: On Thu, May 11, 2017 at 9:10 PM, Uzair Tariq wrote: > A Bundle of thank Constantine Covtushenko now the working to > Authentication Backend for anonymous and inactive users is clear. Just one > last question does the scenario that i defined in m

Re: Permissions for Anonymous Users in Django

2017-05-11 Thread Constantine Covtushenko
ooglegroups.com > <https://groups.google.com/d/msgid/django-users/8a4851aa-77a5-4c9e-b0d6-dc31a85b3262%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Sincerely yours, Constantine C -- You rec

Re: View Function Signature?

2017-05-12 Thread Constantine Covtushenko
Hi, Please check that link <https://docs.djangoproject.com/en/1.11/topics/http/urls/#how-django-processes-a-request> of documentation. For me it was very helpful to understand all pieces of Request/Response cycle. Regards, Constantine C. On Fri, May 12, 2017 at 4:05 PM, nickeforos

Re: View Function Signature?

2017-05-12 Thread Constantine Covtushenko
s a second parameter. At the same time for view function that shows blog might be natural to get 'year' as a second parameter. And so on. I hope that helps. Regards, Constantine C. On Fri, May 12, 2017 at 5:10 PM, Nick Gilmour wrote: > Thanks for the link. I understand these e

Re: Trigger receiver signal on Proxy model

2017-05-12 Thread Constantine Covtushenko
'Item' class? Hope that helps. Regards, Constantine C. On Fri, May 12, 2017 at 8:23 AM, Yarnball wrote: > I'm using a proxy model, so that I can use Elastic search on the same > model using two different serialisers. > > However, the new_index_elastic function never r

Re: Need help in Django User Model customization and authentication

2017-05-13 Thread Constantine Covtushenko
go that way then authentication/authorization based questions should not bring any worries at all. But may be I missed something. If so, please provide us with more concrete questions. Regards, Constantine C. On Sat, May 13, 2017 at 4:23 PM, Ajat Prabha wrote: > Hello everyone, > I'm creatin

Re: Matching query does not exist after a post_data signal, but in fact does exist when visiting the url sent by the query

2017-05-16 Thread Constantine Covtushenko
view' in the DB? Regards, Constantine C. On Tue, May 16, 2017 at 10:17 PM, François-Xavier Cao wrote: > Hi everone, > > > I started to code a two-apps django project. ModelA belongs to appone and > ModelB belongs to apptwo. My purpose is to create a ModelA instance > everyt

Re: Email conformation problem

2017-05-16 Thread Constantine Covtushenko
Hi, Ismail Did you try: *instance.user.email*? I hope it should be what you need. Regards, Constantine C. On Mon, May 15, 2017 at 3:47 PM, Ismail Sarenkapic wrote: > from django.conf import settings > from django.contrib.auth.models import ( > BaseUserManager, Abstrac

Re: Email conformation problem

2017-05-16 Thread Constantine Covtushenko
t; content, can you help me with that? > > > On Wednesday, May 17, 2017 at 8:21:22 AM UTC+2, Constantine Covtushenko > wrote: >> >> Hi, Ismail >> >> Did you try: >> >> *instance.user.email*? >> >> I hope it should be what you need.

Re: Email conformation problem

2017-05-17 Thread Constantine Covtushenko
oialauth etc. > Please don't replay to the posts when you don't know what it is about.tnx > again > > On Wednesday, May 17, 2017 at 8:41:05 AM UTC+2, Constantine Covtushenko > wrote: > > It is not a Django related question, sorry. > I can just suggest to look in 

Re: Model design question

2017-06-25 Thread Constantine Covtushenko
Hi Mark, I have some questions to you. 1. Does any of MetaData have predefined list of MetaDataValues? 2. Can MetaDataValue be assigned to many Documents or it is specific to particular Document? Regards, Constantine C. On Sun, Jun 25, 2017 at 6:20 PM, Mark Phillips wrote: > I have a cl

Re: add users to google group django

2017-07-01 Thread Constantine Covtushenko
by this link <https://developers.google.com/admin-sdk/groups-settings/quickstart/python>. It seems to me that creating GroupList should very straightforward task. Please consider my response as a suggestion only. It is just basic idea. Regards, Constantine C. On Fri, Jun 30, 2017 at

Re: Keep logged in accross Sites

2017-07-01 Thread Constantine Covtushenko
Hello Pablo, +1 to your solution Regards, Constantine C. On Fri, Jun 30, 2017 at 9:06 AM, Pablo Camino Bueno wrote: > Hello, > > I'm using Django Sites framework to hadle different sites, with the same > users. > > I'd like to add a link to switch between my si

Re: Built-in logging module may lead to memory leak?

2017-07-01 Thread Constantine Covtushenko
Hello, Can you please print here a code snippet where you are using: > logger = logging.getLogger(__name__) Regards, Constantine C. On Thu, Jun 29, 2017 at 11:29 PM, Yp Xie wrote: > Hi guys, > > I'm using the python built-in logging module in a django project. Using

Re: Keep logged in accross Sites

2017-07-06 Thread Constantine Covtushenko
by clicking on 'Login' link or implicitly by redirecting from view that require authorization. For the same reason I did not find how to request SSO from the page which is not belongs to domain for which user should be authenticated as you asked below. Does it make any sense to you? Regards, Cons

Re: Updating an instance.

2017-09-29 Thread Constantine Covtushenko
e form. 2 - add user info to POST query. It is not recommended way as this POST QuerySet is immutable. So to do that you need to create new QuerySet from previous one and put user info there. I hope that make some sense. Regards, Constantine C. On Fri, Sep 29, 2017 at 3:11 PM, Mitul Tyagi wrote:

Re: make a button element outside be on the right side of another element inside

2017-09-29 Thread Constantine Covtushenko
Dear Fabio, Can you please provide html of your button here? Thank you, Regards, Constantine C. On Fri, Sep 29, 2017 at 8:37 AM, fábio andrews rocha marques < fabioandrewsrochamarq...@gmail.com> wrote: > unfortunally, it does trigger. I have an input and a button. The button is >

Re: get_ip_address() not working when used Custom Decorators

2017-09-29 Thread Constantine Covtushenko
Hi Mannu, It seems like all are ok. Sorry, but do you use it in just one place? And do you see response in console from your print? Regards, Constantine C. On Thu, Sep 28, 2017 at 4:36 PM, Mannu Gupta wrote: > I am just using it in a view function. For example:- > > @owner_required

Re: Django: Form validation strange behaviour

2017-09-29 Thread Constantine Covtushenko
Hi Paul, You should return value from 'clean_document'. >From your code I see you do not do that. When method returns nothing it is None. That is why you see 'This field cannot be blank.' I hope that make sense. Regards, Constantine C. On Fri, Sep 29, 2017 at 7:01 AM, Pa

Re: Updating an instance.

2017-09-30 Thread Constantine Covtushenko
autocomplete'), >> 'city2': autocomplete.Select2(url='city-autocomplete'), >> 'city3': autocomplete.Select2(url='city-autocomplete'), >> 'city4': autocomplete.Select2(url='city-autocomplete

Re: Add value to database without using forms in django

2017-09-30 Thread Constantine Covtushenko
an do something like that: Name(cityval=''.join([city.city1, city.city2, ...])).save() Regards, Constantine C. On Sat, Sep 30, 2017 at 5:39 AM, Mitul Tyagi wrote: > I have a model named "Name" which stores the list of all cities present in > other model named "C

Re: get_ip_address() not working when used Custom Decorators

2017-10-01 Thread Constantine Covtushenko
of `request` receives `function all`. It looks like improperly used decorator. More than that I do not have more ideas from what you provided. On Sat, Sep 30, 2017 at 4:02 PM, Mannu Gupta wrote: > Hello Constantine C, > > Thanks for your reply! > > What do you mean to say just

Re: Django and Oracle 10g

2017-10-07 Thread Constantine Covtushenko
Hi Paulo, Did you read https://docs.djangoproject.com/en/1.11/ref/databases/#oracle-notes? I did not use oracle backend in any of my projects. But with Django ORM one will never depend on DB type in common scenarios. I hope that helps. Regards, Constantine C. On Sat, Oct 7, 2017 at 8:51 PM

Re: Login form error not showing up for wrong username/password combo

2017-12-02 Thread Constantine Covtushenko
ould print at the top of your form something like this: *{{ form.non_field_errors }}* Regards, Constantine C. On Sat, Dec 2, 2017 at 12:38 AM, Tom Tanner wrote: > I have this code in my login form. > {% for field in login_form %} > {{ field }} > {% if field.errors %} >{{

Re: How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Constantine Covtushenko
Hi, Can you please describe why you did not want to call author.save() explicitly? What is wrong with this approach? Regards, Constantine C. On Mon, Dec 4, 2017 at 7:36 PM, Priyanka Thakur wrote: > Hi, > > > I want to create a bunch of objects that are interconnected in my mode

Re: Need Help with Many to Many Fields

2017-12-08 Thread Constantine Covtushenko
o optimize `get_queryset` of CollecionAdmin instead? Regards, Constantine C. On Fri, Dec 8, 2017 at 8:07 PM, Mark Phillips wrote: > I have two models - > > class Document(models.Model): > document_id = models.AutoField(primary_key=True) > title = models.CharField('title&#

Re: Need Help with Many to Many Fields

2017-12-09 Thread Constantine Covtushenko
ist, check following documentation page: https://docs.djangoproject.com/en/2.0/ref/models/querysets/#values-list Regards, Constantine C. On Sat, Dec 9, 2017 at 12:41 AM, Mark Phillips wrote: > The point of the queries is to get information about the underlying > Documents in each Collection, a

Re: Need Help with Many to Many Fields

2017-12-09 Thread Constantine Covtushenko
cument.all()]) And use the same approach for second method Does it make any sense? Regards, Constantine C. On Sat, Dec 9, 2017 at 11:32 AM, Mark Phillips wrote: > should have been > > class CollectionAdmin(admin.ModelAdmin) > in the above post. > > Mark > > On Sat,

Re: context must be a dict rather than Context.

2017-12-12 Thread Constantine Covtushenko
/docs.djangoproject.com/en/2.0/topics/templates/#django.template.backends.base.Template.render> I hope that makes sense. Regards, Constantine C. On Tue, Dec 12, 2017 at 6:25 AM, Al Scham wrote: > *Hi,* > > *Im a new user going through this tutorial at OverIQ > : https://overi

Re: Multiple roles assign to user in djnago

2017-12-19 Thread Constantine Covtushenko
t make sense? Regards, Constantine C. On Mon, Dec 18, 2017 at 11:38 PM, Ketul Suthar wrote: > I have admin who can create User and Manager > > User (id, name, password,role) > Manager (id, name, password,role) > > > So how can i achieve using admin panel in djnago ? > &g

Re: Multiple roles assign to user in djnago

2017-12-19 Thread Constantine Covtushenko
preferable way to do it. I hope it make sense to you. Regards, Constantine C. On Tue, Dec 19, 2017 at 9:46 AM, Ketul Suthar wrote: > Yes. But I want to assign role to user as normal user and manager based > on selection from drop down in admin site and also add new field role_id in >

Re: Links to comment function in the backend are wrong

2017-12-19 Thread Constantine Covtushenko
Hi Jan, I would suggest to change python version on new server to be the same as on your previous server. Sach an option should be available. Is it a kind of PAAS service in the cloud? If yes, there should be documentation how to do that. Does it make any sense? Regards, Constantine C. On Tue

Re: send / receive data securely from a wifi module... how many steps?

2017-12-19 Thread Constantine Covtushenko
Hi, As soon as I understand you need to enable django authentication for you applications. Please check following django documentation page. <https://docs.djangoproject.com/en/2.0/topics/auth/> Regards, Constantine C. On Fri, Dec 15, 2017 at 11:16 AM, R design wrote: > I've bui