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 want to add more about urls , views, and
>> link with model
>>
>> On Tuesday, 25 September 2018 19:48:12 UTC+2, 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
>> 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/1a3591f6-602f-45ee-87f4-21542e8ccbe3%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/CANwUEV81V09nPCKmpDbd_b3WC_QH9VC5yduWF8-d0XFPrLb81Q%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Royal Civil

-- 
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/CAL5%3DX0VhfVaRN5%3D%3DCqBe8ybGGBmjgrB%2B7d0bQf-YJav76Pts8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/e0bbf3fd-ce0d-4b02-b474-dd27802b9dc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 manage.py makemigrations  - create migration in file different app, 
and no there is no changes in that model.
When I tried manage.py makemigrations  app1 - No changes detected in app 
'app1'




-- 
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/27bb2c1b-9a3c-4c21-8fc9-cfb1bc7ff0c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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/c8200337-b1d4-4adc-941a-0b9215e4e5c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 in this.
>>
>>
>> On Tue 25 Sep, 2018, 11:40 PM Gear Crew, 
>> wrote:
>>
>>> nice man the awesome pdf but I want to add more about urls , views, and
>>> link with model
>>>
>>> On Tuesday, 25 September 2018 19:48:12 UTC+2, 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 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/1a3591f6-602f-45ee-87f4-21542e8ccbe3%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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/CANwUEV81V09nPCKmpDbd_b3WC_QH9VC5yduWF8-d0XFPrLb81Q%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Royal Civil
>
> --
> 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/CAL5%3DX0VhfVaRN5%3D%3DCqBe8ybGGBmjgrB%2B7d0bQf-YJav76Pts8g%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAAcanstWR6oC6qY0TDumc9DNK6s1KT3hfdgS9r71ZKSU3E%3D5aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/f144ae51-a036-4aeb-94d5-d058a4067489%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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?
>
> [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 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/f144ae51-a036-4aeb-94d5-d058a4067489%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAA%3Diw__1LTyN4jt0R41HRudNFMUwzss%2BL9AdwLQcs8A6Sf6Png%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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, null=True)

def __str__(self):
return self.title

this is my sample model

and this is my view

def index(request):
fetch_post_data =
Post.objects.filter(published_date__lte=timezone.now()).order_by('-created_date')[:5]
fetch_pgraph_data = Post.objects.raw("select count(title) as
uno,published_date from blog_post group by DATE(published_date)")
#fetch_pgraph_data = Post.objects.raw("select * from blog_post")
template_var = {'postodj':fetch_post_data,'userdataobj':fetch_pgraph_data}
return render(request,'home.html',context=template_var)


when I am trying to fetch the data using *fetch_pgraph_data*, it's showing
Raw query must include the primary key


-- 
Soumyajit Banerjee



-- 
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/CAG8c6EFsFt_1UwgSch_1mY92x%2BboSrwow7H5umj4-WeYs0f2hg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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'
>super().setup_test_environment(**kwargs)
>?
>otherwise, I'd say to run the test with a custom settings module like
>./manage.py test --settings=test_settings

This seems to be the only viable solution, thanks


>or
>try to override that value in the setUp method of your TestCase class.

I did try this as well and  to my surprise it didn't work eather, even
thought I should spend more time debugging why...

sandro

-- 
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/20180926122138.GA16185%40bluff.e-den.it.
For more options, visit https://groups.google.com/d/optout.


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 service list)
3-  when i save all records in the dynamic field save to the database.


I hope it clear to you. but if you need more information please let me know 
i am glad to discuss with you.

:)

-- 
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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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)* will
> create dynamically.
> 2- In the select *product/service* its an options dropdown. the option
> should have related *model data*(from table product and service list)
> 3-  when i save all records in the dynamic field save to the database.
>
>
> I hope it clear to you. but if you need more information please let me
> know i am glad to discuss with you.
>
> :)
>
> --
> 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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAA%3Diw_9EXkE7h9rU%3Dwyy02AZcM2rKnAFZ2Bn_hKRQP1Q4wS2MA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/e9ede35d-8f96-4100-9193-af701e6372ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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’, DateField())).values(‘uno’, 
‘published_date_date’)

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of soumyajit banerjee
Sent: Wednesday, September 26, 2018 7:17 AM
To: django-users@googlegroups.com
Subject: django raw sql query does not return data

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, null=True)



def __str__(self):

return self.title

this is my sample model

and this is my view

def index(request):

fetch_post_data = 
Post.objects.filter(published_date__lte=timezone.now()).order_by('-created_date')[:5]

fetch_pgraph_data = Post.objects.raw("select count(title) as 
uno,published_date from blog_post group by DATE(published_date)")

#fetch_pgraph_data = Post.objects.raw("select * from blog_post")

template_var = {'postodj':fetch_post_data,'userdataobj':fetch_pgraph_data}

return render(request,'home.html',context=template_var)

when I am trying to fetch the data using fetch_pgraph_data, it's showing Raw 
query must include the primary key


--
Soumyajit Banerjee

[http://cdn2.hubspot.net/hubfs/184235/dev_images/signature_app/facebook_sig.png]
  
[http://cdn2.hubspot.net/hubfs/184235/dev_images/signature_app/linkedin_sig.png]
 



--
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/CAG8c6EFsFt_1UwgSch_1mY92x%2BboSrwow7H5umj4-WeYs0f2hg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/fa8b3342e418433c9768db663266ebef%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


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 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)* will 
>> create dynamically.
>> 2- In the select *product/service* its an options dropdown. the option 
>> should have related *model data*(from table product and service list)
>> 3-  when i save all records in the dynamic field save to the database.
>>
>>
>> I hope it clear to you. but if you need more information please let me 
>> know i am glad to discuss with you.
>>
>> :)
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/2140d58d-fc8b-4dcf-9acd-d965afa46cbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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):
transaction = models.OneToOneField(Transaction, primary_key=True, 
on_delete=models.CASCADE)
parent_sn = models.ForeignKey(SN, blank=True, null=True, 
on_delete=models.CASCADE)



class Calculations(models.Model):
part = models.OneToOneField(Part, blank=False, null=False, 
on_delete=models.CASCADE, primary_key=True)
i_qty = models.FloatField(blank=True, null=True)


Whenever the user creates a new inventory transaction or updates the qty in a 
transaction that has an inventory transaction, I want to be able to change 
Calculations.i_qty.  I've been using pre_save signals on the 
InventoryTransaction as the sender, but I've come to an obstacle.

When the user creates or deletes an inventory transaction, the calculation is 
perfect.  The problem comes when the user changes an inventory transaction 
because the sender should actually be Transaction, and not 
InventoryTransaction, since qty is on the Transaction field.  Sometimes I may 
update the Transaction instance without making any changes to the 
InventoryTransaction instance, so the signal is never called to update 
Calculations.i_qty.

However, if I modify the signal to change the sender to the Transaction model, 
I get problems when creating an InventoryTransaction because the relation 
hasn't been established yet so we don't know that it's actually an 
InventoryTransaction that is being created.  If I make a signal to handle both 
Transaction and InventoryTransaction, the calculation is performed multiple 
times, which provides bad results.

I've considered using transaction atomicity.  Maybe I'm just missing something 
in my signals.  How do you typically handle this type of situation?
Thank you in advance!


-- 
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/698328c67a3f4e7f90321b95303b488f%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


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 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 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)* will
>>> create dynamically.
>>> 2- In the select *product/service* its an options dropdown. the option
>>> should have related *model data*(from table product and service list)
>>> 3-  when i save all records in the dynamic field save to the database.
>>>
>>>
>>> I hope it clear to you. but if you need more information please let me
>>> know i am glad to discuss with you.
>>>
>>> :)
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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/2140d58d-fc8b-4dcf-9acd-d965afa46cbc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAA%3Diw_8%3D6wQ7kg0TshMDHEBnD7hPfRq65nERkOMO%3D4XoDZ%2BjAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 jquery, it should be easy.
>
>
>
> > On Wed, 26 Sep 2018 at 19:25, 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
> > >
> > >
> > >
> > > 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 Django Lover,  
> > > > > wrote:
> > > > > > Hi joel Thank for response.
> > > > > >
> > > > > > I want something like this-
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > 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 
> > > > > > service list)
> > > > > > 3-  when i save all records in the dynamic field save to the 
> > > > > > database.
> > > > > >
> > > > > >
> > > > > > I hope it clear to you. but if you need more information please let 
> > > > > > me know i am glad to discuss with you.
> > > > > >
> > > > > > :)
> > > > > >
> > > > > > --
> > > > > > 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...@googlegroups.com.
> > > > > > To post to this group, send email to django...@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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com.
> > > > > > For more options, visit https://groups.google.com/d/optout.
> > > --
> > > 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/2140d58d-fc8b-4dcf-9acd-d965afa46cbc%40googlegroups.com.
> > > For more options, visit https://groups.google.com/d/optout.
> --
> 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/CAA%3Diw_8%3D6wQ7kg0TshMDHEBnD7hPfRq65nERkOMO%3D4XoDZ%2BjAg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/ff9add3b-5d44-42a5-b8b2-cdf43476acdb%40Spark.
For more options, visit https://groups.google.com/d/optout.


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:


https://www.jqueryscript.net/tags.php?/dynamic%20form/

Looks like something like this:

https://www.jqueryscript.net/form/Dynamic-Form-Creation-Deletion.html

is exactly what you need?

Of course you still need to handle the submitted form on the server 
(Django) side and you might not be able to use most of Djangos builtin 
form handling functionality, but someone else definitely knows more 
about that than me.


Kind regards,

Kasper Laudrup

--
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/2b7a307d-d338-dc0e-f738-770f1245805c%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


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 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/CADpGDPXz0F0X1G%2BcPPY18khBb34nfUronL9T6ZjOBjw7-7bccQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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 manage.py makemigrations  - create migration in file different app, 
> and no there is no changes in that model.
> When I tried manage.py makemigrations  app1 - No changes detected in app 
> 'app1'
>
>
>
>
>

-- 
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/97554e80-b497-4fc6-be6d-e4fa84b1addd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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/6c1e9a72-ef4d-4405-9cec-5ce3a3e2d046%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.
>
> 24-09-2018  16:37  .
> 24-09-2018  16:37  ..
> 23-09-2018  15:06  college
> 19-09-2018  08:56   554 manage.py
> 19-09-2018  10:59  section
>1 File(s)554 bytes
>4 Dir(s)  32,464,281,600 bytes free
>
> 4. Execute the makemigrations, but it prompting with the error. 
>
> C:\Users\srini\djangoProjects\college>*python manage.py makemigrations 
> section*
> App 'section' could not be found. Is it in INSTALLED_APPS?
>
> 5. FYI: Also registered in apps.py
>
> from django.apps import AppConfig
>
>
> class ClassConfig(AppConfig):
> name = 'section'
>
>
> On Sun, Sep 23, 2018 at 7:26 PM Adolfo Cueto  > wrote:
>
>> First you have to change your model name Class names starts with 
>> uppercase...
>>
>> My friend.. you are not making migrations... look at you have to do this:
>>
>>
>> 1. Delete your migration folder
>> 2. Delete you app table manually (DROP table)
>> 3. python manage.py makemigrations app_name
>> 4. migrate
>>
>> that's all
>>
>> El sábado, 22 de septiembre de 2018, 4:10:45 (UTC-5), Srinivas Gadi 
>> escribió:
>>>
>>> HI All,
>>>
>>> I am facing below error while creating a new model class.
>>> the error pop up only at this line "user = models.OneToOneField(User)"
>>> *"E1120:No value for argument 'on_delete' in constructor call"*
>>>
>>> from django.db import models
>>> from django.contrib.auth.models import User
>>>
>>> class userProfile(models.Model):
>>> user = models.OneToOneField(User)
>>>
>>> If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)" 
>>> the error got subsided but the new class "userProfile" is not appearing 
>>> in admin page, under Users tab.
>>>
>>> Could some one please guide me how to fix this ?
>>>
>>> -- 
>>> Srinivas .G
>>>   9966559383
>>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/42ee3cf4-5347-4371-b9aa-343aa946c191%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Srinivas .G
>   9966559383
>

-- 
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/765c04b2-1ed2-4e30-92a0-2a28f60c178d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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',
'body':'Updated text',
})

L

Il giorno mercoledì 26 settembre 2018 14:53:54 UTC+2, Gear Crew ha scritto:
>
>
> 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 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/a5524b61-821c-4fd5-ab4f-483de638eedc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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/fc5736a8-3396-491b-b265-853f46fdad87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 Gadi ha
> scritto:
>>
>> Thank you for the response,
>> 1. Deleted the migrations folder
>> 2. Removed the SQLite3 DB itself
>> 3. My dir structure.
>>
>> 24-09-2018  16:37  .
>> 24-09-2018  16:37  ..
>> 23-09-2018  15:06  college
>> 19-09-2018  08:56   554 manage.py
>> 19-09-2018  10:59  section
>>1 File(s)554 bytes
>>4 Dir(s)  32,464,281,600 bytes free
>>
>> 4. Execute the makemigrations, but it prompting with the error.
>>
>> C:\Users\srini\djangoProjects\college>*python manage.py makemigrations
>> section*
>> App 'section' could not be found. Is it in INSTALLED_APPS?
>>
>> 5. FYI: Also registered in apps.py
>>
>> from django.apps import AppConfig
>>
>>
>> class ClassConfig(AppConfig):
>> name = 'section'
>>
>>
>> On Sun, Sep 23, 2018 at 7:26 PM Adolfo Cueto  wrote:
>>
>>> First you have to change your model name Class names starts with
>>> uppercase...
>>>
>>> My friend.. you are not making migrations... look at you have to do this:
>>>
>>>
>>> 1. Delete your migration folder
>>> 2. Delete you app table manually (DROP table)
>>> 3. python manage.py makemigrations app_name
>>> 4. migrate
>>>
>>> that's all
>>>
>>> El sábado, 22 de septiembre de 2018, 4:10:45 (UTC-5), Srinivas Gadi
>>> escribió:

 HI All,

 I am facing below error while creating a new model class.
 the error pop up only at this line "user = models.OneToOneField(User)"
 *"E1120:No value for argument 'on_delete' in constructor call"*

 from django.db import models
 from django.contrib.auth.models import User

 class userProfile(models.Model):
 user = models.OneToOneField(User)

 If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)"
 the error got subsided but the new class "userProfile" is not
 appearing in admin page, under Users tab.

 Could some one please guide me how to fix this ?

 --
 Srinivas .G
   9966559383

>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/42ee3cf4-5347-4371-b9aa-343aa946c191%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Srinivas .G
>>   9966559383
>>
> --
> 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/765c04b2-1ed2-4e30-92a0-2a28f60c178d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Srinivas .G
  9966559383

-- 
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/CAPC7spj%2ByxD0J8o4ESC1xEFT%3DxcSBnTfTRZGVDuJevBTaDBaiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.