Query on 2 non related models

2019-05-20 Thread Ivan Martić
Hi guys, hope you can help me. I have 2 models and i want to make a count query on them. I need a count on how many articles i have in every category. Models: class Vendors(models.Model): id = models.AutoField(db_column='id', primary_key=True, blank=False, unique=True) name = models.Cha

Re: Passing values

2019-02-13 Thread Ivan Martić
e.now is allways available in any python file you are > working on it, and also request and request.user > > What do you want to do exactly? > > On Wednesday, February 13, 2019 at 1:45:46 PM UTC+3:30, Ivan Martić wrote: >> >> Hi all, >> >> where can i find mor

Passing values

2019-02-13 Thread Ivan Martić
Hi all, where can i find more info regarding passing values in views/forms/url. What I need is to pass value from form in previous url page to the form in next url page(also prefilling with data like timezone.now, request,user) Thank you in advance. Ivan -- You received this message because yo

Re: The database driver doesn't support modern datatime types.

2019-02-11 Thread Ivan Martić
resolved. Microsoft ODBC driver was missing, download it from MS official web page and all is working perfect now On Monday, February 11, 2019 at 11:21:37 AM UTC+1, Ivan Martić wrote: > > Hi all, > > I am migrating to from development to prod server and getting this error >

The database driver doesn't support modern datatime types.

2019-02-11 Thread Ivan Martić
Hi all, I am migrating to from development to prod server and getting this error app. Error started to show after installation of allauth library. I cant find anything on google related to this topic so I hope you can help me out. Traceback is saying: Exception Type: ImproperlyConfigured at /

Re: NoReverseMatch at - Reverse with arguments '('',)' not found

2019-02-07 Thread Ivan Martić
t; > thanks in advance. > waiting for a reply > > On Mon, Feb 4, 2019 at 5:18 PM Ivan Martić > wrote: > >> Hi all, >> >> I need help. >> I keep getting this issue, NoReverseMatch at / >> Reverse for 'productsgrouping-update' with arguments 

NoReverseMatch at - Reverse with arguments '('',)' not found

2019-02-04 Thread Ivan Martić
Hi all, I need help. I keep getting this issue, NoReverseMatch at / Reverse for 'productsgrouping-update' with arguments '('',)' not found. 1 pattern(s) tried: ['update/(?P[0-9]+)/$'] not sure what am doing wrong. Any time I put url tag {% url 'productsgrouping-update' lista.id%} in html i get

Re: Passing pk arguments from a URL into another view

2019-02-04 Thread Ivan Martić
Can you elaborate a bit, i have the same issue with noreverse error ned, 3. velj 2019. u 15:08 poOya mOsaddegh napisao je: > Hi > You may use include in urls.py > > urlpatterns = [ > path('', views.club_home, name='club_home'), > path('/', include(club_home_urls, namespace='club_home')),

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-02-01 Thread Ivan Martić
i think i found the issue, problem was in the html url tag.. i should look like this href="{ url 'update_group' list_all.url_id }"> not like this href="{ url 'update_group' item.id }"> thank you all pet, 1. velj 2019. u 09:26 Ivan Martić napisao je

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-02-01 Thread Ivan Martić
Hi guys, any help on this matter? i still have noreverse issue. There is something wrong with my url nameing sri, 30. sij 2019. u 10:55 Ivan Martić napisao je: > Bok Nebojša, jel možeš uletit i pogledati molim te što radim krivo. >>> >>> Znači, imam 2 aplikacije, prva abc

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-30 Thread Ivan Martić
> > Bok Nebojša, jel možeš uletit i pogledati molim te što radim krivo. >> >> Znači, imam 2 aplikacije, prva abc radi a druga product groups ne radi.. >> Sve je kopirano u 2 privitka. >> >> Da li imaš vremena pogledati pliz? >> > Šta god napravim, No reverse mi se javlja... -- You received th

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
gde je greška > > уто, 29. јан 2019. у 13:51 Ivan Martić је > написао/ла: > >> napravio sam točno kako si rekao i dalje nece, isti error ...vec danima >> se mucim sa ovime..nešto drugo je posrijedi. >> >> >> >> >> >> uto, 29. sij 2019. u 12:16

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
view(request, url_id): > assigned = get_object_or_404(Material, pk=url_id) > > > naravno prvo moraš da importuješ get object or 404: > > from django.shortcuts import get_object_or_404 > > > уто, 29. јан 2019. у 12:00 Ivan Martić је > написао/ла: > >> Bok N

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
gt; https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/ > > Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako: > def productsgrouping_update_view(request, url_id): > product_lista = get_object_or_404(MaterialGroup, pk=url_id) > > > уто, 29.

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
not sure what to say čet, 24. sij 2019. u 13:53 Ivan Martić napisao je: > Hi Andréas, > sorry for misspeling in codes. All is working ok except when i try to put > url tag for 'update_productsgrouping'. > I need to update group with new products but It does not argument

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-24 Thread Ivan Martić
t; You may mean: > {{ item }} - {{ > item.id}} > ? > > Regards, > > Andréas > > > Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić : > >> Hi all, >> >> i am having issue with url tag, every time i put url tag like --{% url >> 'p

NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-24 Thread Ivan Martić
Hi all, i am having issue with url tag, every time i put url tag like --{% url 'productsgrouping' item.id%}-- i get no reverse error. Can you help me figure it out on what am i doing wrong? view: def productsgrouping_view(request): queryset = MaterialGroup.objects.all() context = {"list" : query

Re: Matching query does not exist

2019-01-18 Thread Ivan Martić
er Laudrup napisao je: > Hi Ivan, > > On 1/18/19 10:59 AM, Ivan Martić wrote: > > Thank you Kasper, > > > > You're welcome. > > > i have copied that model after doing inspectdb. So it should be set by > > default from django that way. Usually all was ok..

Re: Matching query does not exist

2019-01-18 Thread Ivan Martić
Thank you Kasper, i have copied that model after doing inspectdb. So it should be set by default from django that way. Usually all was ok.. Also, i have tried that change now and got the same result. Any other idea where i gone wrong? -- You received this message because you are subscribed t

Matching query does not exist

2019-01-18 Thread Ivan Martić
Hi all, i am having trouble to get this query on db table right. I am always getting error. Please check shell erorr attached. I appreciate your help! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
st.POST or None, > initial={'supplier_name':request.user}) > if prepoznaj_form.is_valid(): > prepoznaj_form.save() > > context = { > 'prepoznaj_form': prepoznaj_form > } > > return render(request, 'prepoznaj/forma.html&#x

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
P/1.1" 200 8939 [15/Jan/2019 13:01:33] "GET /performance/ HTTP/1.1" 200 14799 [15/Jan/2019 13:01:39] "POST /performance/ HTTP/1.1" 200 14811 Da li ovi podaci mogu što pomoći? uto, 15. sij 2019. u 12:54 Ivan Martić napisao je: > Nažalost, iz nekog razloga ne prolazi

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
form = PerformanceForm[request.POST] > if form.is_valid(): > form.save() > return render(request, 'qif/performance.html', {"form" : form}) > > ovako nekako bi trebalo da radi > > уто, 15. јан 2019. у 12:49 Ivan Martić је > написао/ла: > >> Ej

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
ni sad sam u nekoj bas velikoj guzvi, evo ti otprilike kako sam ja na > drugoj formi uradio, ako ne uspes ispisacu ti malo kasnije > [image: image.png] > > уто, 15. јан 2019. у 12:26 Ivan Martić је > написао/ла: > >> Bravo! radi! >> Samo što sad neradi spremanje (reque

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
Bravo! radi! Samo što sad neradi spremanje (request.POST)...kako da to sad implementiram, jel može savjet? uto, 15. sij 2019. u 12:22 Nebojsa Hajdukovic napisao je: > Obrisi ovo request.post or none > > uto, 15. jan 2019. 12:19 Ivan Martić je > napisao/la: > >> Bok Neboj

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
dodaj ovako u views.py: > view: > def performance_view(request): > form = PerformanceForm({'supplier_name':request.user}) > if form.is_valid(): > form.save() > return render(request, 'qif/performance.html', {"form" : form}) > > уто, 15. јан 2019. у 09

Populate modelform field with username

2019-01-15 Thread Ivan Martić
Hi all, can someone assist me. I cant get the modelform field get populated with active username. Does any one have a good advice? view: def performance_view(request): form = PerformanceForm(request.POST or None) if form.is_valid(): form.save() return render(request, 'qif/performance.html', {"f

Re: ms sql server connectivity to django

2019-01-07 Thread Ivan Martić
Hi mate, I had the same issue with MS SQL. This worked for me: DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'HOST': 'xxx', 'PORT': '1433', 'USER': 'xxx', 'PASSWORD': 'xxx', 'NAME': 'xx',#table name 'CONN_MAX_AGE': 0,

Re: ms sql server connectivity to django

2019-01-07 Thread Ivan Martić
Hi Mate, I had the same issues with connecting to MS SQL. This is the configuration which worked for me... DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'HOST': 'XXX', 'PORT': '1433', 'USER': 'XXX', 'PASSWORD': 'XXX', 'NAME': 'XXX',