django raw sql query does not return data

2018-09-26 Thread soumyajit banerjee
Hi everyone, class Post(models.Model): author = models.ForeignKey('auth.User',on_delete=models.CASCADE,) title = models.CharField(max_length=200) text = RichTextField() created_date = models.DateTimeField(default=timezone.now) published_date = models.DateTimeField(blank=True,

Re: How to add form field dynamically?

2018-09-26 Thread Django Lover
Hi joel Thank for response. *I want something like this-* [image: form.png] 1- when I click on *add row* button a new Row (*No-2)* will create dynamically. 2- In the select *product/service* its an options dropdown. the option should have related *model data*(from table product and

Re: How to add form field dynamically?

2018-09-26 Thread Joel
Describe what you mean by add dynamically. If blocks in templates allow a great deal of flexibility. On Wed 26 Sep, 2018, 5:16 PM Django Lover, wrote: > I am creating a model form, i need to add a field dynamically can you > please give me the solution by using your sharp intelligence? > >

what's args parameter in reverse()

2018-09-26 Thread Gear Crew
what's the useful form args=''1" here and why use 1 not anything else def test_post_update_view(self): response = self.client.post(reverse('post_edit',args='1'),{ 'title':'Updated title', 'body':'Updated text', })Enter code here... -- You received this message

RE: django raw sql query does not return data

2018-09-26 Thread Matthew Pava
Listen to the error message. Include the primary key in the queryset. You can use any field and alias it as “id” if you need to trick the system. Although, couldn’t that raw query use the ORM in a better way? Post.objects.annotate(uno=Count(‘title’), published_date_date=Cast(‘published_date’,

Re: How to add form field dynamically?

2018-09-26 Thread Django Lover
Then What is the solution please let HELP ME?? I know that it will done by Jquery but how? I dont Know On Wednesday, September 26, 2018 at 6:14:07 PM UTC+5:30, Joel wrote: > > I don't think django alone can help you here. You need to do that with > JavaScript. > > On Wed 26 Sep, 2018, 6:01 PM

Re: DEFAULT_FILE_STORAGE and tests

2018-09-26 Thread Alessandro Dentella
Ciao Luca! On Tue, Sep 25, 2018 at 12:29:45PM -0700, Luca Bocchi wrote: >Already tried with: >class GeneraliDiscoverRunner(DiscoverRunner): >def setup_test_environment(self, **kwargs): >settings.DEFAULT_FILE_STORAGE = 'web.storage.TestStorage' >

Re: hi friends am sending how to create a project in django with step by step. if you are satisfied please send me comments

2018-09-26 Thread Pardhu Saradhi
hi you need to add some more content to this On Wed, Sep 26, 2018 at 10:20 AM Dheeraj Kumar wrote: > Sudha, > Its very helpful for us. Thanks so much. > > Grace, > > I didn't get what u add in this. > > > On Tue 25 Sep, 2018, 11:40 PM Gear Crew, > wrote: > >> nice man the awesome pdf but I

rest api is installed but does not run

2018-09-26 Thread Dilip Krishna
Put 'rest_framework' in INSTALLED_APPS and run migrations -- 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

Re: hi friends am sending how to create a project in django with step by step. if you are satisfied please send me comments

2018-09-26 Thread Vineet Kothari
Yes need to how to connect with git. On Wed 26 Sep, 2018, 4:45 PM Pardhu Saradhi, wrote: > hi you need to add some more content to this > > On Wed, Sep 26, 2018 at 10:20 AM Dheeraj Kumar wrote: > >> Sudha, >> Its very helpful for us. Thanks so much. >> >> Grace, >> >> I didn't get what u add

Make migration issue for a unique True filed.

2018-09-26 Thread jisson varghese
I have model MyModel in app app1 class MyModel(models.Model): ... name = models.CharField(max_length=10, unique=True) I have made the following change, class MyModel(models.Model): ... name = models.CharField(max_length=10, unique=True, null=False) python

rest api is installed but does not run

2018-09-26 Thread Dilip Krishna
For rest api you need to insert 'rest_framework' in INSTALLED_APPS After modifying settings.py , you need to re-run migrations using python manage.py makemigrations python manage.py migrate Check whether you have done that. -- You received this message because you are subscribed to

Running Signal when Related Field is Updated

2018-09-26 Thread Matthew Pava
I have a similar set up to this (simplified): class Transaction(models.Model): sns = models.ManyToManyField(SN, related_name="transactions", blank=True) qty = models.FloatField() part = models.ForeignKey(Part, on_delete=models.CASCADE) class InventoryTransaction(models.Model):

Re: How to add form field dynamically?

2018-09-26 Thread Joel Mathew
You would use jquery to create the button using the $(selector).html(code). Since this doesnt fall within the scope of this django group, I wont elaborate. If you know basic javascript and jquery, it should be easy. On Wed, 26 Sep 2018 at 19:25, Django Lover wrote: > Then What is the solution

Re: How to add form field dynamically?

2018-09-26 Thread matteo gassend (LanguageMatt)
You could always mix jquery with formsets Il 26 set 2018, 18:02 +0200, Joel Mathew , ha scritto: > You would use jquery to create the button using the $(selector).html(code). > Since this doesnt fall within the scope of this django group, I wont > elaborate. If you know basic javascript and

Re: How to add form field dynamically?

2018-09-26 Thread Kasper Laudrup
Hi Django Lover, On 26/09/2018 15.55, Django Lover wrote: Then What is the solution please let HELP ME?? I know that it will done by Jquery but how? I dont Know The first hit I got on a search for "jquery dynamic form" sent me to this page:

Sql server

2018-09-26 Thread Elton Oliveira
Hello guys, I'm having two difficulties and I wonder if anyone can help me, first I need to change the names of the auth tables of Django to follow the standard of company names, second I need to create the security tables in a custom schema in SQL Server, does anyone have any tips? -- You

Re: Make migration issue for a unique True filed.

2018-09-26 Thread luca bocchi
fields are not null by default, so you don't need: *null=False* that's why *makemigrations* doesn't detect changes in the *MyModel* model. L Il giorno mercoledì 26 settembre 2018 13:16:24 UTC+2, jisson varghese ha scritto: > > > I have model MyModel in app app1 > > class

Sql Server

2018-09-26 Thread Elton Oliveira
Hello guys, how do I create my tables in other SQL server schemas? OBS: I tried everything and I could not -- 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

Re: Error at OneToOneField in models while creating new models class

2018-09-26 Thread luca bocchi
seems that your app is not in settings.INSTALLED_APPS, add 'section' there and retry. L Il giorno lunedì 24 settembre 2018 13:22:48 UTC+2, Srinivas Gadi ha scritto: > > Thank you for the response, > 1. Deleted the migrations folder > 2. Removed the SQLite3 DB itself > 3. My dir structure. > >

Re: what's args parameter in reverse()

2018-09-26 Thread luca bocchi
args should be a list or a tuple, although is not specified clearly in the docs: https://docs.djangoproject.com/en/1.11/ref/urlresolvers/#reverse def test_post_update_view(self): response = self.client.post(reverse('post_edit',args=['1']),{ 'title':'Updated title',

Can anyone share code for uploading csv or excel file to sqlite3 database.

2018-09-26 Thread BBG
I want to create upload bulk data. Can anyone share code to upload csv or excel file. -- 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

How to add form field dynamically?

2018-09-26 Thread Django Lover
I am creating a model form, i need to add a field dynamically can you please give me the solution by using your sharp intelligence? [image: synm.png] Product/service are coming from the model field.they are not static. Add New is unlimited. please help -- You received this message

Re: How to add form field dynamically?

2018-09-26 Thread Joel
I don't think django alone can help you here. You need to do that with JavaScript. On Wed 26 Sep, 2018, 6:01 PM Django Lover, wrote: > Hi joel Thank for response. > > *I want something like this-* > > [image: form.png] > > > > > > > > > > 1- when I click on *add row* button a new Row (*No-2)*

Re: Error at OneToOneField in models while creating new models class

2018-09-26 Thread Srinivas Gadi
It was fixed by adding the "section.apps.Class.Config" in settings INSTALLED_APPS On Thu, Sep 27, 2018 at 5:05 AM luca bocchi wrote: > seems that your app is not in settings.INSTALLED_APPS, add 'section' there > and retry. > > L > > Il giorno lunedì 24 settembre 2018 13:22:48 UTC+2, Srinivas

Re: hi friends am sending how to create a project in django with step by step. if you are satisfied please send me comments

2018-09-26 Thread Vineet Kothari
Thanks it is quite useful for coming out of drak sublime On Tue 25 Sep, 2018, 11:16 PM Sudha Mohan, wrote: > > -- > 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 >

Re: Starting a New Project somewhat like multitenant saas appication.

2018-09-26 Thread Scot Hacker
It's a little tough to understand what your actual questions are, but: > the role-based authentication I can do but is there any other better option or thing available? The native Django permissions system is limited to specifying who can see or edit particular models (and even then, is