Re: New to Django

2016-08-16 Thread Luis Zárate
Hi,

Try to implement a custom tag that can print
Any dictionary in the form that you want.

https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/




El martes, 16 de agosto de 2016, Wolf Painter 
escribió:
> Anyone have any ideas? I'm really stuck 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/dee8a26d-adee-4567-84a0-fccd4de478be%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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/CAG%2B5VyNzeD5ux4bam80%2Bfrrq2xkBTuBihRzi2wp%2BBRvuGWFeYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django

2016-08-16 Thread Wolf Painter
Anyone have any ideas? I'm really stuck 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/dee8a26d-adee-4567-84a0-fccd4de478be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrations for forms fields

2016-08-16 Thread ludovic coues
forms.Form are python class representing an HTML form. You use them to
ask data to your user. Nothing more.

models.Model are python class representing an entry in your database.
You create them in python, always.

Sometimes, you use a form by itself. For exemple, a login form will
ask data, search a user matching these data and log you in if a user
is found.

Sometimes, you use a form to create an object. A signup form for
exemple. You will use a form to ask data then create a user object
with the data.

But even in this last exemple, the form object isn't related to the
models object, in the sense each one can live without the other and
have (nearly) non-overlapping role. The form object don't touch the
database and the model object don't provide a form.


I'm not sure I am being clear enough so don't hesitate to ask question.

2016-08-16 9:13 GMT+02:00 Gergely Polonkai :
> Hello,
>
> rename migrations in your head to database migrations, or even model to
> database migrations.
>
> The migration process takes all your models and applies all the changes in
> them to your database (usually an SQL instance in the wild).
>
> Forms, on the other hand, are just that: forms, that can get some input from
> somewhere. Although they can be used to interact with models (in fact, there
> is ModelForm designed specifically for this case), they are not models,
> thus, migrations don't apply to them.
>
> Hope that makes the picture clear.
>
> Best,
> Gergely
>
>
> On Tue, Aug 16, 2016, 00:56 Pranjal Tale  wrote:
>>
>> Hello!
>> I was writing my models with forms.Forms and after writing when i run
>> "python manage.py makemigrations app_label" it shows the error as "app not
>> deceted".
>>
>> And at at same time when i build some models with models.Model and when i
>> run the same command so all the migrations get implemented.
>>
>> It is so that for forms based models migrations are not applied
>> If not i am unable to find the bug
>> Please Help
>> Thanks.
>>
>> --
>> 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/f2b8c7cb-4e9c-4543-a80c-65d5bee3d935%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/CACczBUK-iZkH3u_KSYkT%2B%2BO2e2%3D8ckzBk6KegSC0uQeYTwv-5Q%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
I found the problem.

We run our MySql in master-slave. Somehow, our slave was out of sync. We
updated some tables but this app was reading our slave.

Thanks all!!







2016-08-16 15:58 GMT-03:00 Avraham Serour :

> did you checked if it cached in the browser? does nginx gets the request?
> if so what does it answers?
>
>
> On Tue, Aug 16, 2016 at 7:07 PM, 술욱  wrote:
>
>> Because this particular query runs in about 30 seconds and its result
>> ends up in an excel file, which is generated with openpyxl from a template.
>>
>> If I change the template, the file returned by django is this new file,
>> but its contents, the query result, doesn't (and it executes immediately).
>>
>> --
>> 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/ms
>> gid/django-users/CADut3oBz1Yo6YJMT3u%3Dv6n%3DCsrgaizwT2cFJE2
>> V4zcpu6soXmw%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/CAFWa6t%2BuJhCHQz54wRC%2B3q7swfxRf4qbXSZiGWvpngq1H7-
> tFg%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/CADut3oD4UGGVTpcree9gFfO5NBTZ_W7z8gopgaE8KdiBA6pt%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using the Django ORM in a long-running worker process

2016-08-16 Thread Daniel Tao
Can I bump this topic back to the top?

   1. I actually don't know if this will work (not an experienced Google 
   Groups user here).
   2. Even if it does work, I don't know if this is considered bad form or 
   something. If so, apologies.


On Monday, August 15, 2016 at 11:28:26 AM UTC-5, Daniel Tao wrote:
>
> Hi folks,
>
> My team has built a service comprising 3 main parts, a web application and 
> 2 long-running worker processes that process events from a message 
> exchange. All of these components interact with the same database and use 
> the same underlying Django "app" for ORM models (i.e. the 2 worker 
> processes call django.setup() on initialization).
>
> We've had some issues with the worker processes failing to recover in the 
> face of DB connectivity issues. For example at one point Amazon restarted 
> our DB (it's an RDS instance) and the workers started flailing, repeatedly 
> raising the same exceptions despite the DB coming back online. Later on we 
> discovered that we could fix this particular issue by calling 
> django.db.connection.close() when this exception occurred (it happened to 
> be InterfaceError); on the next attempt to interact w/ the DB Django would 
> establish a new connection to the DB and everything would continue to work. 
> More recently a new error occurred that caused a similar problem, leading 
> us to speculate that we should do the same thing in this case with this new 
> type of exception (I think now it's OperationalError because the DB went 
> into "recovery mode" or something).
>
> We are now planning on refactoring this service a bit so that instead of 
> attempting to recover from exceptions, we'll just terminate the process and 
> configure an external agent to automatically restart in the face of 
> unexpected errors. This feels like a safer design than trying to figure out 
> every exception type we should be handling. However I wanted to reach out 
> to the Django group as a sanity check to see if we're missing something 
> more basic. From browsing various tickets in Django's issue tracker I've 
> gotten the impression that we may be swimming upstream a little bit as 
> Django is designed as a web framework and relies on DB connections being 
> closed or returned to a pool or something automatically at the end of the 
> request cycle, not held open by a single loop in a long-running process. Is 
> there something special we should be doing in these worker processes? A 
> special Django setting perhaps? Should we just be calling 
> connection.close() after processing each event? Should we not be using 
> Django at all in this case?
>
> I think the pessimistic kill-and-restart strategy we've decided upon for 
> now will work, but any guidance here to ensure we aren't fighting against 
> our own framework would be much appreciated.
>
> Dan Tao
>

-- 
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/a6eb7859-3a22-4aaa-8982-3f5b11ef18d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advice on python version for new project

2016-08-16 Thread Rich Shepard

On Tue, 16 Aug 2016, Avraham Serour wrote:


https://virtualenv.pypa.io/en/stable/


  Thanks, Avraham. Looks interesting.

Rich


Re: Advice on python version for new project

2016-08-16 Thread Avraham Serour
https://virtualenv.pypa.io/en/stable/


On Tue, Aug 16, 2016 at 1:36 AM, Rich Shepard 
wrote:

> On Tue, 16 Aug 2016, Avraham Serour wrote:
>
> you should also create a virtualenv for the project
>>
>
> Avraham,
>
>   OK. Please point me to some docs for this.
>
> Regards,
>
> Rich
>

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


Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Avraham Serour
did you checked if it cached in the browser? does nginx gets the request?
if so what does it answers?


On Tue, Aug 16, 2016 at 7:07 PM, 술욱  wrote:

> Because this particular query runs in about 30 seconds and its result ends
> up in an excel file, which is generated with openpyxl from a template.
>
> If I change the template, the file returned by django is this new file,
> but its contents, the query result, doesn't (and it executes immediately).
>
> --
> 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/CADut3oBz1Yo6YJMT3u%3Dv6n%
> 3DCsrgaizwT2cFJE2V4zcpu6soXmw%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/CAFWa6t%2BuJhCHQz54wRC%2B3q7swfxRf4qbXSZiGWvpngq1H7-tFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Subtracting UNIX_TIMESTAMPS broke in Django 1.10

2016-08-16 Thread Dan Edwards
I have a query that works in Django 1.9.9 but not 1.10. Running on CentOS 
7, with python 2.7.5, and MySQL 5.6.23 on Amazon RDS
Example:

class TaskLog(models.Model):
id = models.AutoField(primary_key=True)
start = models.DateTimeField(auto_now_add=True)
stop = models.DateTimeField(blank=True, null=True, default=None) 

Query =  TaskLog.objects.extra(select = {"day": "left(start, 
10)"}).values("day").annotate(sum=Sum(Func(F('stop'), 
function='UNIX_TIMESTAMP') - Func(F('start'), function='UNIX_TIMESTAMP')))

In 1.9.9 the value for sum would be the sum of the number of seconds 
between start and stop. 
In 1.10 it is always None.

The sql generated is:
Django 1.9.9:
SELECT (left(start, 10)) AS `day`, SUM((UNIX_TIMESTAMP(`TaskLog`.`stop`) - 
UNIX_TIMESTAMP(`TaskLog`.`start`))) AS `sum`  FROM `TaskLog` WHERE 
(`TaskLog`.`user_id` = 22) GROUP BY UNIX_TIMESTAMP(`TaskLog`.`stop`), 
UNIX_TIMESTAMP(`TaskLog`.`start`), (left(start, 10)) ORDER BY NULL

Django 1.10:
SELECT (left(start, 10)) AS `day`, SUM(TIMESTAMPDIFF(MICROSECOND, 
UNIX_TIMESTAMP(`TaskLog`.`start`), UNIX_TIMESTAMP(`TaskLog`.`stop`))) AS 
`sum` FROM `TaskLog` WHERE (`TaskLog`.`user_id` = 22) GROUP BY (left(start, 
10)) ORDER BY NULL

It looks like the new temporal subtraction feature to swap out the - with 
TIMESTAMPDIFF is the problem. Maybe it shouldn't do that for 
UNIX_TIMESTAMPs?

I fixed my app by simplifying my code to not convert to UNIX_TIMESTAMP 
before subtracting:
Query =  TaskLog.objects.extra(select = {"day": "left(start, 
10)"}).values("day").annotate(sum=Sum(F('stop') - F('start')))

But thought I should still report that subtracting UNIX_TIMESTAMPs appears 
to be broken

-- 
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/8309dec9-edfd-4b07-b9ed-26a19dec01b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to save one field value from a model to another field of a linked model.

2016-08-16 Thread Md. Ohiduzzaman
I have designed a linked model named Shiftdate as:

class Shiftdate(models.Model):
shift_date = models.DateField(blank=False,unique=True)
sit_date = models.ForeignKey(Sitting,
on_delete=models.CASCADE)

Using this model I changed sit_date to shift_date which is like: 

Sitting Date Shifting Date2016-09-01   Sept. 15, 20162016-09-08   
Sept. 19, 2016


Now I need to save this shifting date to the Sitting date as sit_date in 
Sitting model. My Sitting model is:

class Sitting(models.Model):
sit_date = models.DateField(blank=False,unique=True)
cut_off_date = models.DateField(null=True, blank=True)
ballot_date = models.DateField(null=True, blank=True)
sess_no = models.ForeignKey(Session,
 on_delete=models.CASCADE)
genre = TreeForeignKey('Genre', null=True, blank=True, db_index=True)


I use 

def get_shift_date(self):

return self.sit_date=self.shift_date 

-- 
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/8894d393-5d97-4c97-ba56-1a319d93acec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to save one field value from a model to another model field

2016-08-16 Thread Md. Ohiduzzaman


down votefavorite 


I designed two models: one model for storing Sitting date and another mode 
for storing Shifting date. Two model are linked by foreign key. Here is my 
two models:

class Sitting(models.Model):
sit_date = models.DateField(blank=False,unique=True)
cut_off_date = models.DateField(null=True, blank=True)
ballot_date = models.DateField(null=True, blank=True)
sess_no = models.ForeignKey(Session,
 on_delete=models.CASCADE)
genre = TreeForeignKey('Genre', null=True, blank=True, db_index=True)

Shift Model:

 class Shiftdate(models.Model):
shift_date = models.DateField(blank=False,unique=True)
sit_date = models.ForeignKey(Sitting,
on_delete=models.CASCADE)

Using Shift model's shift_date, I changed existing sitting dates to other 
dates as:

Sitting Date Shifting Date2016-09-01   Sept. 15, 20162016-09-08   
Sept. 19, 2016


Now I want to make these shift date to a new sitting dates.  For this I 
define following method in Sitting model:


def get_shift_date(self):
return self.sit_date= self.shift_date 


And this shift_date to be saved in the Sitting model in sit_date field. I 
define following save method:

 def save(self, *args, **kwargs):  
self.sit_date = self.get_shift_date()
super(Sitting, self).save(*args, **kwargs)


But this did not return shift dates as sitting dates. Could someone help me 
to fix this codes?

-- 
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/271b2d7e-c5d1-4981-9e97-d5fb8b18f47a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Forcing Localization

2016-08-16 Thread Fred Stluka

  
  
Adam,

 Is it possible to force localization to a
  particular regional standard, no matter where I am viewing the
  page from?

I don't know for sure, but it seems like some of these settings
should be relevant.  It's a place to start anyhow.  Anyone have 
a more specific answer?

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating
systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same
as your
# system time zone.
TIME_ZONE = 'US/Eastern'

# Language code for this installation. All choices can be found
here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

# If you set this to False, Django will make some optimizations so
as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers
and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware
datetimes.
USE_TZ = True

INPUT_FORMATS = [
    '%Y-%m-%d',   # '2006-10-25'
    '%m/%d/%Y',   # '10/25/2006'
    '%m/%d/%y',   # '10/25/06'
    '%b %d %Y',   # 'Oct 25 2006'
    '%b %d, %Y',  # 'Oct 25, 2006'
    '%d %b %Y',   # '25 Oct 2006'
    '%d %b, %Y',  # '25 Oct, 2006'
    '%B %d %Y',   # 'October 25 2006'
    '%B %d, %Y',  # 'October 25, 2006'
    '%d %B %Y',   # '25 October 2006'
    '%d %B, %Y',  # '25 October, 2006'
]

--Fred


  
  Fred Stluka -- mailto:f...@bristle.com --
  http://bristle.com/~fred/
  
  Bristle Software, Inc -- http://bristle.com -- Glad to be of
  service!
  
  Open Source: Without walls and fences, we need no Windows or
  Gates.
  
  

On 8/7/16 9:48 PM, Adam Starrh wrote:


  
I am writing an application
  for my small business based in India, where numbers are
  commonly understood in terms of lakhs and crores.
ie. 1,000,000 is
  displayed as 10,00,000
I am assuming that enabling
  localization will cause numbers to display this way when I am
  viewing my application from an Indian server. However, I would
  also like to view the data this way when I am in the United
  States. Is it possible to force localization to a particular
  regional standard, no matter where I am viewing the page from?
  
  -- 
  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/604036bf-2557-4c63-8718-3950dd89010f%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/52ffb9cd-000c-6e58-dc5e-a03341da2998%40bristle.com.
For more options, visit https://groups.google.com/d/optout.


Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
Because this particular query runs in about 30 seconds and its result ends
up in an excel file, which is generated with openpyxl from a template.

If I change the template, the file returned by django is this new file, but
its contents, the query result, doesn't (and it executes immediately).

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


Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Bill Freeman
Cached in browser, maybe?

On Tue, Aug 16, 2016 at 11:43 AM, Avraham Serour  wrote:

> How do you know the query is cached?
>
> On Aug 16, 2016 6:33 PM, "술욱"  wrote:
>
>> I forgot to say I reloaded (and restarted) nginx and uwsgi, but the query
>> is still cached
>>
>>
>> Thanks anyway!
>>
>>
>>
>>
>> 2016-08-16 12:24 GMT-03:00 M Hashmi :
>>
>>> Reload Nginx and see if still its loading cached query.
>>>
>>> On Tue, Aug 16, 2016 at 8:18 AM, 술욱  wrote:
>>>
 Hello

 I'm running (in production) and app that uses raw queries, something
 like:

 query = """
 select table1.field1, table2.field3
 from table1 left join table2
on test1.field1 = test2.field1
and test1.field2 = test2.field2
 where table1.field1 = %(param1)s
 """

 cursor = connections['database'].cursor()
 cursor.execute(query, {'param1': param1-value})
 data = cursor.fetchall()


 My problem is, somewhere, Django, uwsgi, or nginx, is caching this
 query.

 How do I find who's caching?


 Thanks,
 Norberto

 --
 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/ms
 gid/django-users/CADut3oCG%2Bc%3D8CFm5Mf0YiBtK3RMa-0KrZZG6wb
 0_ihDwkDmqkQ%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/ms
>>> gid/django-users/CANoUts63A-mGo-KOYJHBFJtOut9gasWX3A8dso3%3D
>>> v0myFwgAgg%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/ms
>> gid/django-users/CADut3oBoqHS7JCV8vs2o2Z%2BHDsr5LQeTDnGm34bd
>> PTJbcOkhDg%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/CAFWa6tKMSQ077%2BuRm-Kp1iGNS%
> 2BUbGLcZihpE%3Dphwc69KNhJEVg%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/CAB%2BAj0sMGbzCcAT_9ksuOc7iKE_bU_hHmCRaskbUB%3Dsvssa0Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Avraham Serour
How do you know the query is cached?

On Aug 16, 2016 6:33 PM, "술욱"  wrote:

> I forgot to say I reloaded (and restarted) nginx and uwsgi, but the query
> is still cached
>
>
> Thanks anyway!
>
>
>
>
> 2016-08-16 12:24 GMT-03:00 M Hashmi :
>
>> Reload Nginx and see if still its loading cached query.
>>
>> On Tue, Aug 16, 2016 at 8:18 AM, 술욱  wrote:
>>
>>> Hello
>>>
>>> I'm running (in production) and app that uses raw queries, something
>>> like:
>>>
>>> query = """
>>> select table1.field1, table2.field3
>>> from table1 left join table2
>>>on test1.field1 = test2.field1
>>>and test1.field2 = test2.field2
>>> where table1.field1 = %(param1)s
>>> """
>>>
>>> cursor = connections['database'].cursor()
>>> cursor.execute(query, {'param1': param1-value})
>>> data = cursor.fetchall()
>>>
>>>
>>> My problem is, somewhere, Django, uwsgi, or nginx, is caching this
>>> query.
>>>
>>> How do I find who's caching?
>>>
>>>
>>> Thanks,
>>> Norberto
>>>
>>> --
>>> 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/ms
>>> gid/django-users/CADut3oCG%2Bc%3D8CFm5Mf0YiBtK3RMa-0KrZZG6wb
>>> 0_ihDwkDmqkQ%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/ms
>> gid/django-users/CANoUts63A-mGo-KOYJHBFJtOut9gasWX3A8dso3%3D
>> v0myFwgAgg%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/CADut3oBoqHS7JCV8vs2o2Z%2BHDsr5LQeTDnGm34bdPTJbcOkhDg%
> 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/CAFWa6tKMSQ077%2BuRm-Kp1iGNS%2BUbGLcZihpE%3Dphwc69KNhJEVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
I forgot to say I reloaded (and restarted) nginx and uwsgi, but the query
is still cached


Thanks anyway!




2016-08-16 12:24 GMT-03:00 M Hashmi :

> Reload Nginx and see if still its loading cached query.
>
> On Tue, Aug 16, 2016 at 8:18 AM, 술욱  wrote:
>
>> Hello
>>
>> I'm running (in production) and app that uses raw queries, something like:
>>
>> query = """
>> select table1.field1, table2.field3
>> from table1 left join table2
>>on test1.field1 = test2.field1
>>and test1.field2 = test2.field2
>> where table1.field1 = %(param1)s
>> """
>>
>> cursor = connections['database'].cursor()
>> cursor.execute(query, {'param1': param1-value})
>> data = cursor.fetchall()
>>
>>
>> My problem is, somewhere, Django, uwsgi, or nginx, is caching this query.
>>
>> How do I find who's caching?
>>
>>
>> Thanks,
>> Norberto
>>
>> --
>> 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/ms
>> gid/django-users/CADut3oCG%2Bc%3D8CFm5Mf0YiBtK3RMa-0KrZZG6wb
>> 0_ihDwkDmqkQ%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/CANoUts63A-mGo-KOYJHBFJtOut9gasWX3A8dso3%
> 3Dv0myFwgAgg%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/CADut3oBoqHS7JCV8vs2o2Z%2BHDsr5LQeTDnGm34bdPTJbcOkhDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread M Hashmi
Reload Nginx and see if still its loading cached query.

On Tue, Aug 16, 2016 at 8:18 AM, 술욱  wrote:

> Hello
>
> I'm running (in production) and app that uses raw queries, something like:
>
> query = """
> select table1.field1, table2.field3
> from table1 left join table2
>on test1.field1 = test2.field1
>and test1.field2 = test2.field2
> where table1.field1 = %(param1)s
> """
>
> cursor = connections['database'].cursor()
> cursor.execute(query, {'param1': param1-value})
> data = cursor.fetchall()
>
>
> My problem is, somewhere, Django, uwsgi, or nginx, is caching this query.
>
> How do I find who's caching?
>
>
> Thanks,
> Norberto
>
> --
> 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/CADut3oCG%2Bc%3D8CFm5Mf0YiBtK3RMa-
> 0KrZZG6wb0_ihDwkDmqkQ%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/CANoUts63A-mGo-KOYJHBFJtOut9gasWX3A8dso3%3Dv0myFwgAgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
Hello

I'm running (in production) and app that uses raw queries, something like:

query = """
select table1.field1, table2.field3
from table1 left join table2
   on test1.field1 = test2.field1
   and test1.field2 = test2.field2
where table1.field1 = %(param1)s
"""

cursor = connections['database'].cursor()
cursor.execute(query, {'param1': param1-value})
data = cursor.fetchall()


My problem is, somewhere, Django, uwsgi, or nginx, is caching this query.

How do I find who's caching?


Thanks,
Norberto

-- 
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/CADut3oCG%2Bc%3D8CFm5Mf0YiBtK3RMa-0KrZZG6wb0_ihDwkDmqkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Web based IDE for django

2016-08-16 Thread Daniel França
hmm, not sure if I got what you want...but have you tried cloud9?
https://c9.io/

On Tue, 16 Aug 2016 at 07:30 Jani Tiainen  wrote:

> Hi,
>
> Just for curiosity, can you point out any web based editor does what
> you're asking for, even not Python based?
>
> To me it sounds that you want to have some kind of (web based) wizard to
> generate most of the code for you. Since you feel repeating your way of
> workin, why not to write IDE yourself?
>
> On 15.08.2016 23:47, billyhu...@gmail.com wrote:
>
> New in django so here is the question: Is there a web based IDE for django
> where the environments are set up and all we focus on the creating models,
> view and control? It seems most of my time is spend creating url, import
> this, import that, put middleware, 90% of the time is spend worrying about
> the framework that actually doing the work. Its 2016 and its still seems
> like going back in time with the framework where everything is very manual
> driven.
> --
> 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/c4d176a6-6d96-41cc-b571-f95c3e4f39b6%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/90bc6b07-5273-90fc-6ec0-c2b284b567c3%40gmail.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/CACPst9KHnwJfUqtGw2n8SAtOO6YVBX76SDSvv8vYddBB-36jrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use django.contrib.postgres.forms widgets in the admin site

2016-08-16 Thread François Schiettecatte
Go to the group web page at :

https://groups.google.com/group/django-users

Click on the My Settings icon (human figure and gear icon, top right) and click 
‘Leave this group’

François


> On Aug 16, 2016, at 6:28 AM, Elizabeth Mawer  
> wrote:
> 
> Hi
> 
> I accidentally got signed up with this group and actually don't want to 
> receive emails.
> How do I unsubscribe?
> At the bottom of this email it says: To unsubscribe from this group and stop 
> receiving emails from it, send an email to 
> django-users+unsubscr...@googlegroups.com.
> But when I have used that email it is invalid, so I continue to receive 
> dozens of emails?
> 
> Any ideas?
> 
> Thanks,
> Liz
> 
> 
> From: django-users@googlegroups.com  on behalf 
> of Jay Sheldon 
> Sent: 16 August 2016 08:55
> To: Django users
> Subject: How to use django.contrib.postgres.forms widgets in the admin site
>  
> Hi there,
> 
> I just recently updated my database to postgres, looking to play with the 
> django supported field types HStoreField and JSONField (reference: 
> https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/ )
> 
> I got the install working fine, but in my admin section - the widgets that 
> come with HStoreField is not appearing (reference: 
> https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/forms/ )
> 
> I cant see to figure out how to get the admin side to use the widget for 
> HStoreField.
> 
> Any ideas?
> 
> Thank you very much,
> Jay
> -- 
> 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/ce96dfbc-765d-4fb8-9ea8-9c6b3fa5017c%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/VI1PR07MB14708EEBB3B8CBB3C3DB6DEFC3130%40VI1PR07MB1470.eurprd07.prod.outlook.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/B6918EDB-AA0E-453A-9A67-A6D7C242B057%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use django.contrib.postgres.forms widgets in the admin site

2016-08-16 Thread Elizabeth Mawer
Hi


I accidentally got signed up with this group and actually don't want to receive 
emails.

How do I unsubscribe?

At the bottom of this email it says: To unsubscribe from this group and stop 
receiving emails from it, send an email to 
django-users+unsubscr...@googlegroups.com.

But when I have used that email it is invalid, so I continue to receive dozens 
of emails?


Any ideas?


Thanks,

Liz



From: django-users@googlegroups.com  on behalf 
of Jay Sheldon 
Sent: 16 August 2016 08:55
To: Django users
Subject: How to use django.contrib.postgres.forms widgets in the admin site

Hi there,

I just recently updated my database to postgres, looking to play with the 
django supported field types HStoreField and JSONField (reference: 
https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/ )

I got the install working fine, but in my admin section - the widgets that come 
with HStoreField is not appearing (reference: 
https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/forms/ )

I cant see to figure out how to get the admin side to use the widget for 
HStoreField.

Any ideas?

Thank you very much,
Jay

--
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/ce96dfbc-765d-4fb8-9ea8-9c6b3fa5017c%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/VI1PR07MB14708EEBB3B8CBB3C3DB6DEFC3130%40VI1PR07MB1470.eurprd07.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


How to use django.contrib.postgres.forms widgets in the admin site

2016-08-16 Thread Jay Sheldon
Hi there,

I just recently updated my database to postgres, looking to play with the 
django supported field types HStoreField and JSONField 
(reference: https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/ 
)

I got the install working fine, but in my admin section - the widgets that 
come with HStoreField is not appearing (reference: 
https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/forms/ )

I cant see to figure out how to get the admin side to use the widget for 
HStoreField.

Any ideas?

Thank you very much,
Jay

-- 
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/ce96dfbc-765d-4fb8-9ea8-9c6b3fa5017c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Form Mixins with multilayered M2M models

2016-08-16 Thread Ali khan
Hi,

I have three models like below:

Shop:
 |
  Products
|
Variations

Where Shop has a ForeignKey for products and then products has foreign key
for variations. So Shop has no ForeignKey with Variations directly instead
connected via Products model.

1. I am new to Django and I need to understand that in ShopListView view
how to reference variations.

2. Also I need to create a form using FormSetFactory where I can grab data
from all the models in hierarchy. Like my form should have edit options for
Shop's own model fields with Products model fields and Variation Fields.

Would appreciate any help.

Regards,
Ali

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


Re: Migrations for forms fields

2016-08-16 Thread Gergely Polonkai
Hello,

rename migrations in your head to database migrations, or even model to
database migrations.

The migration process takes all your models and applies all the changes in
them to your database (usually an SQL instance in the wild).

Forms, on the other hand, are just that: forms, that can get some input
from somewhere. Although they can be used to interact with models (in fact,
there is ModelForm designed specifically for this case), they are not
models, thus, migrations don't apply to them.

Hope that makes the picture clear.

Best,
Gergely

On Tue, Aug 16, 2016, 00:56 Pranjal Tale  wrote:

> Hello!
> I was writing my models with forms.Forms and after writing when i run
> "python manage.py makemigrations app_label" it shows the error as "app not
> deceted".
>
> And at at same time when i build some models with models.Model and when i
> run the same command so all the migrations get implemented.
>
> It is so that for forms based models migrations are not applied
> If not i am unable to find the bug
> Please Help
> Thanks.
>
> --
> 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/f2b8c7cb-4e9c-4543-a80c-65d5bee3d935%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/CACczBUK-iZkH3u_KSYkT%2B%2BO2e2%3D8ckzBk6KegSC0uQeYTwv-5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.