no migrations folder

2016-03-08 Thread Becka R.
Hi, 

My migrations aren't being created.  I think that's the problem, anyway - 
there's no migrations folder, and the table I've created doesn't exist when 
I search in the shell.  

Here's 'my file structure:


/ladynerds manage.py db.sqlite3 /ladynerds /static /templates __init.__py 
forms.py models.py settings.py urls.py views.py wsgi.py

And when I run manage.py makemigrations I get this traceback:

('/Users/rebeccaeliserobbins/Documents/repos/LadynerdsNEW/ladynerds/ladynerds/templates',)

look here:/static/

/Users/rebeccaeliserobbins/Documents/repos/LadynerdsNEW/ladynerds/ladynerds/views.py:7:
 
RemovedInDjango110Warning: django.core.context_processors is deprecated in 
favor of django.template.context_processors.

  from django.core.context_processors import csrf


/Users/rebeccaeliserobbins/Documents/repos/LadynerdsNEW/ladynerds/ladynerds/urls.py:27:
 
RemovedInDjango110Warning: Support for string view arguments to url() is 
deprecated and will be removed in Django 1.10 (got 
django.contrib.auth.views.login). Pass the callable instead.

  url(r'^login/', 'django.contrib.auth.views.login', 
name='foo',kwargs={'template_name': 'login.html'}),


/Users/rebeccaeliserobbins/Documents/repos/LadynerdsNEW/ladynerds/ladynerds/urls.py:28:
 
RemovedInDjango110Warning: Support for string view arguments to url() is 
deprecated and will be removed in Django 1.10 (got 
django.contrib.auth.views.logout). Pass the callable instead.

  url(r'^logout/', 'django.contrib.auth.views.logout', name='logout', 
kwargs={'next_page': index}),


System check identified some issues:


WARNINGS:

*?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 
1.8 and the TEMPLATES dictionary takes precedence. You must put the values 
of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.*

No changes detected



My templates are loading correctly except that I'm getting the "no such 
table" errors.  


What's going on?  I'm using Django 1.9


Thanks so much. 


Becka





-- 
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/f6f79414-6260-4f6e-9c4b-7719db3e11ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django middleware cache settings

2016-03-08 Thread nav


Hi

I have a need to use memcache on a particular view/controller and wanted to 
know if the middleware cache settings:

'django.middleware.cache.UpdateCacheMiddleware','django.middleware.common.CommonMiddleware','django.middleware.cache.FetchFromCacheMiddleware',

are required if all I want to do for is just cache the response, from just 
a single view not the entire site.

It does not seem clear to me from the documentation here 
.

I hope someone can shed some light on this.

Thanks in advance.

nav

P.S. Also posted this question on StackOverflow but did not receive a 
response will post the reply there.

-- 
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/8ce9eab1-fac1-46e9-a84e-0a6d136eb6e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


execute code at startup

2016-03-08 Thread Julien Greard
Hello,

I am using Django 1.9.3. I have a project with several apps. I would like 
to update the tables of one of the app at the startup of the project.

I have all the code written, it looks like the following (it's an example):

from my_app.models import My_table

def on_startup():
 my_thread = Thread(execute = populate_tables, loopmode = True, 
background = True) *# thread running in loopmode in background*
 my_thread.start() *# starts the thread and returns*

def populate_tables()
 response = call_webservice() *# let's imagine this method returns data 
for creating a new model instance*
 My_table(response).save() # this save() isn't threadsafe in this 
example, but that's not my point ;-)

So far, with Django 1.6.5, I came with some code from the __init__.py file 
of my app. It was working, but I thought it was quite ugly (starting a 
thread with an "import" looks really like hidden code).

I saw in Django 1.9 the "ready()" method. But it's written in the 
documentation to not deal with models in this method so I am confused.

I could add the startup code in the command starting my server but this 
startup code is app oriented and in my opinion, the projects has nothing to 
do with my app.

What do you recommend?


I'd be happy to provide more info if needed.

Thanks in advance,

Julien Gréard

-- 
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/373baa6f-a5d7-4821-9ac5-e9fcdf3adf82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango: strip z dimension; force 2D

2016-03-08 Thread Jason
I had a similar issue when uploading a kml to geojson conversion to postgis 
using geodjango.  There is no efficient way to do it in Django, so I ended 
up doing a workaround


   - Create two geometry types, one with dims=2 and other with dims=3. 
Allow both to be null and set default to null
   - When updating, check the geometry dimension via GEOSGeometry.hasz 
   
.
 
If the return is 2, save the geom in the 2D field, otherwise save to the 3D

You can create a save/retrieve method on the model to handle this for 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/93bf0664-7627-4a47-93df-6c8fb1238f35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: MultipleCharField

2016-03-08 Thread Bernardo Garcia
Hi RAfael.

I am using this app for multi select 
fields https://github.com/goinnn/django-multiselectfield
which perform a render the options like checkbox of multiple selection in 
the django admin forms

You should install it of this way

1. Download the tar.gz file from 
https://pypi.python.org/pypi/django-multiselectfield
2. Inside of your virtual environment execute pip install 

3. Specify 'multiselectfield' in the INSTALLED_APPS in settings.py

view this 
source 
http://stackoverflow.com/questions/27332850/django-multiselectfield-cant-install

When you run the Django Server, if you are using Django 1.9.2 you see this 
warning 

site-packages/multiselectfield/db/fields.py:45: RemovedInDjango110Warning: 
SubfieldBase has been deprecated. Use Field.from_db_value instead.
  return metaclass(cls.__name__, cls.__bases__, orig_vars)

THis warning is related with this, but I unknown how to fix for the context 
of multiselectfield package application.


Another alternatives for multiselects fields are:
https://github.com/PragmaticMates/django-clever-selects
https://github.com/theatlantic/django-select2-forms
https://github.com/kelvinwong-ca/django-select-multiple-field
https://github.com/digi604/django-smart-selects which I am also using it! 
this works models based in ManyToMany relationships.

I hope that these resource are useful for you.

Best Regards.



 
On Friday, March 4, 2016 at 3:38:05 PM UTC-5, Rafael Macêdo wrote:
>
> Sou iniciante em Django e gostaria de saber se há algum tipo de campo na 
> classe Model semelhante ao MultipleChoiceField da classe Form.
>
> Obrigado desde já.
>

-- 
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/5eeb00db-664b-4c60-90eb-f8f7f7997c7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: please tell me the best way to construct a Model of Quiz form

2016-03-08 Thread Avraham Serour
I believe a model similar to the poll app from the tutorial would be
appropriate


On Tue, Mar 8, 2016 at 10:20 AM, Jun Tanaka  wrote:

> Hi,
>
> I am trying to make a form for Quizzes. I hope to know how to construct a
> model which be added choices. A model should be constructed by three parts
> as
>
> Question
> the number of right answer
> several buttons to choose
>
> for example of a model,
> class Quiz(models.Model):
> question = models.CharField( max_length=40)
> image_url = models.URLField(blank=True, null=True)
> correct_ans_num = models.IntegerField(default=1,editable=True)
> button1 = models.CharField(help_text=u'button1', max_length=20)
> button2 = models.CharField(help_text=u'button2', max_length=20)
> button3 = models.CharField(help_text=u'buton3', max_length=20)
>
>
> But a problem here is the number of buttons i fixed. I prefer to add
> buttons later, and hopefully be able to input data in one admin page.
> Please tell me what your best solution of a model should be like.
>
> Jun
>
>
>
> --
> 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/b5380222-7afd-4ffc-a3a7-04864161ec38%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/CAFWa6tKbMmb3oyfU%3DyPmYi_%3DuXrfx0%2BfwpkT5oAHs2ORKFg7Aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Is the builtin "password_change" view calls function "reverse" missing arguments?

2016-03-08 Thread Sen Ni
When I use the builtin "password_change" view, I came with an error, so I 
check the source code in "django/contrib/auth/views.py", (django version 
1.9.0) , at line 308, call the function "reverse", just the argument 
"password_change_done".
Then I check the "reverse" in "django/core/urlresolvers.py", It seems 
without argument "current_app" it cannot find the right place where my 
"password_change_done" is?, so it made my problem, because my 
"password_change" and "password_change_done" views are in the 
"authentication" app.
The error message : “Reverse for 'password_change_done' with arguments '()' 
and keyword arguments '{}' not found. 0 pattern(s) tried: []”
It is a mistake or I missing somewhat?
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/6c7ae859-e006-4e5d-9a03-8aeb0f6bb1b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Single Page Application in Django

2016-03-08 Thread nikhil . ikhar
I m not sure if my first post went through or not.

We are also trying to move to SPA using angular.js.
While going to through this app https://github.com/Tivix/django-rest-auth, 
It seems that we have to use Token authentication on web and mobile. 
Session authentication is not an option. Is it true?

Currently we serve html pages using django session authentication on web. 
If I use only token authentication then how can I serve html templates?

-Nikhil

On Monday, 7 March 2016 19:57:06 UTC+5:30, tizonzon wrote:
>
> Django Rest Framework. A powerful framework to build REST API on top of 
> Django.
>
> Here's the link http://www.django-rest-framework.org/
>
> On Mon, Mar 7, 2016 at 9:19 AM, Bob Gailer  > wrote:
>
>>
>> On Mar 7, 2016 7:04 AM, "Avraham Serour"  
>> wrote:
>> >
>> >  DRF 
>> I'll bite - what is DRF? Google does not help with 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...@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/CAP1rxO7AxoUPEpw85at7dRmAuRWL8FTZAok9-dkO24%3Dh2M7KdA%40mail.gmail.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
>
> *Adolphe CHER-AIME*
>

-- 
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/dbb572b6-a6b8-4995-b946-a3ad1b7b5035%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Single Page Application in Django

2016-03-08 Thread nikhil . ikhar
I m also working on SPA with angular.js. One problem I have is regarding 
authentication. 

We have currently mixture of angular.js and html pages served by django but 
our new version will be SPA.
Till now our project was using session authentication (web) & token 
authentication (mobile). 

I was trying to get password related api on REST.While integrating 
https://github.com/Tivix/django-rest-auth it seems that in SPA we have to 
use token authentication on web.

If I allow only token authentication on web + mobile then,
Will token authentication allow us to serve partial templates? Our template 
are currently served by django.

-Nikhil

On Monday, 7 March 2016 19:57:06 UTC+5:30, tizonzon wrote:
>
> Django Rest Framework. A powerful framework to build REST API on top of 
> Django.
>
> Here's the link http://www.django-rest-framework.org/
>
> On Mon, Mar 7, 2016 at 9:19 AM, Bob Gailer  > wrote:
>
>>
>> On Mar 7, 2016 7:04 AM, "Avraham Serour"  
>> wrote:
>> >
>> >  DRF 
>> I'll bite - what is DRF? Google does not help with 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...@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/CAP1rxO7AxoUPEpw85at7dRmAuRWL8FTZAok9-dkO24%3Dh2M7KdA%40mail.gmail.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
>
> *Adolphe CHER-AIME*
>

-- 
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/7e122521-b02b-4a09-a28c-535f508c95c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Development of web based image processing package

2016-03-08 Thread Suresh Saini
Install OpenCV and build with python , then you can do real time image 
processing using UI , You want to real time image processing on web server 
then you have to need setup all configuration of OpenCV on web server and 
have to need web consol

On Thursday, March 3, 2016 at 11:17:56 PM UTC+5:30, Neha Chhattani wrote:
>
> hello
> i want to create a website that will do image processing in real time. i 
> want to load large tiff images i.e. images used in remote sensing and 
> satellite images. I want to do processing on satellite images. is it 
> possible to do this processing in website using django? If yes, how to 
> start with? what are the requirements for this? 
>

-- 
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/2fc85abf-1272-480d-b74c-135d3a74f2c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Django.19 upgrade and circular imports

2016-03-08 Thread Andres Osinski
So I've tried going back to Django 1.7 but changing the app configuration
to use the AppConfig class and I've hit upon the same issue.

It would seem that part of the key is the fact that when the system hits
this line:

/home/osinski/Projects/feastly/apps/account/models.py in ()
 11
 12 from ipdb import set_trace; set_trace()
---> 13 from apps.common.models import CommonInfo
 14 from feastly.paths import get_path

ImportError: No module named common.models

It would appear as though the "common" module hasn't loaded in apps yet.
Some posts on previous versions of Django have advised that the 'apps'
subdirectory should be included in the system path; we have never done this
before and thus far things have worked well, however I don't know if this
was suppored behavior. The negative to doing that is that I'd have to
rename all the imports from 'apps.X' to 'X'.

Does Django support apps that reside in submodules or have I been depending
on broken behavior?


On Fri, Mar 4, 2016 at 5:16 PM, Andres Osinski 
wrote:

> The thing is that in my case, I have a model in the 'accounts' app which
> inherits from a model in 'common', therefore I need the import to happen in
> one's models.
>
> I've tried this in Django 1.8 and I see the same behavior; therefore the
> change occurs between the latest versions of 1.7 and 1.8. I'll try with
> older versions in 1.8 and report back.
>
> On Thu, Mar 3, 2016 at 10:11 PM, James Schneider 
> wrote:
>
>> On Thu, Mar 3, 2016 at 3:28 PM, Andres Osinski 
>> wrote:
>>
>>> Hi everyone! I'm having an issue with circular imports in Django 1.9
>>> that I have not seen in my app, which had been running 1.7 before.
>>>
>>> I have a Django app in apps.common, which has its associated
>>> apps.common.models too. No imports on __init__.py or anything of the sort.
>>> When I my app in apps.account.models attempts to import
>>> apps.common.models, it complains that said module does not exist.
>>>
>>> Putting a pdb set_trace() call at the top of apps.common.models and
>>> apps.account.models shows that the former executes *before*
>>> apps.account.models, so I fail to see how this could result in the posted
>>> error.
>>>
>>> For the record, both apps use the new AppConfig scheme in their
>>> corresponding apps.py file, and the import order in INSTALLED_APPS is:
>>>
>>> 'apps.common.CommonConfig',
>>> 'apps.account.AccountConfig',
>>> ...
>>>
>>> Has anyone else had a similar issue in this upgrade? Is there anything I
>>> can do to diagnose the source of this?
>>>
>>
>> Are you bringing in other functions in as part of your imports, or just
>> other models? If you are only bringing in models for use with FK's and
>> M2M's, then I would suggest referring to those models via their text path
>> rather than using the Python class object directly. It avoids needing the
>> import statement during the initial load (which avoids the circular import
>> issue). See the end of this section about referring to models in other
>> applications using a string rather than the real Python object (and make
>> sure to remove the related import statements):
>>
>> https://docs.djangoproject.com/en/1.9/ref/models/fields/#foreignkey
>>
>> -James
>>
>> --
>> 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/CA%2Be%2BciUWHXr6axqA5drrsMnR3%2B9d0D1wBHSK9wQwSmqs52xFAw%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Andrés Osinski
>



-- 
Andrés Osinski

-- 
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/CA%2BxF-Pz%2BMoK-zZcfwMyB3YYAGvVPL9K8Zkpt8skW-oEyqD0nAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: RegExp problems

2016-03-08 Thread Michal Petrucha
On Mon, Mar 07, 2016 at 05:44:08PM -0800, jorrit...@gmail.com wrote:
> I'm trying to replace *[URL]www.link.com[/URL]* with HTML with this regexp:
> 
> topic.text = re.sub("(\[URL\])(.*)(\[\/URL\])", '$2', topic
> .text, flags=re.I)
> 
> But it's giving me the following problems:
> 
>1. The $2 capture group is only able to be repeated once, so I get 
>$2
>instead of 
>www.link.com

I have my doubts – if you use the standard Python re library, then the
way to refer to captured groups is "\1", "\2", etc., not "$1". When I
try the code you posted above, I get the following result (i.e., not
even the first occurrence of "$2" gets substituted)::

>>> re.sub("(\[URL\])(.*)(\[\/URL\])", '$2', 
'[URL]www.link.com[/URL]', flags=re.I)
'$2'

In order to make the substitution work for a single occurrence of
[URL]...[/URL], you can use the following, which uses "\2" (Also, when
writing regular expressions, or other strings that are supposed to
contain the backslash character, it is a good idea to write them as
raw string literals, i.e. prefix them with a "r", which I've done
below; that way, Python won't try to interpret the backslashes as
special characters – otherwise, "\2" would become a character with an
ASCII value of 2)::

>>> re.sub(r"(\[URL\])(.*)(\[\/URL\])", r'\2', 
'[URL]www.link.com[/URL]', flags=re.I)
'www.link.com'

>2. Only the first *[URL]* is matched. Everything after the first *[/URL]* 
>is simply deleted...

The solution above gets you halfway there – re.sub will replace all
matches by default, the problem here is that the "(.*)" part of your
regex will matches everything between the first "[URL]", and the last
"[/URL]"::

>>> re.sub(r"(\[URL\])(.*)(\[\/URL\])", r'\2', 
'[URL]www.link1.com[/URL][URL]www.link2.com[/URL][URL]www.link3.com[/URL]', 
flags=re.I)
'www.link1.com[/URL][URL]www.link2.com[/URL][URL]www.link3.com'

The reason is that the asterisk operator in a regex is greedy, which
means a ".*" will try to match as much as possible. When you use the
non-greedy version of the operator (which you get by putting a
question mark after the asterisk), you get the result you want::

>>> re.sub(r"(\[URL\])(.*?)(\[\/URL\])", r'\2', 
'[URL]www.link1.com[/URL][URL]www.link2.com[/URL][URL]www.link3.com[/URL]', 
flags=re.I)
'www.link1.comwww.link2.comwww.link3.com'


You can read an explanation of the difference between greedy and
non-greedy regular expressions in the Python docs:
https://docs.python.org/2/howto/regex.html#greedy-versus-non-greedy

Good luck,

Michal

>
> I hope someone can help me with this. I'm using Python 2.7 if it makes a 
> difference.
> 
> -- 
> 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/fce5a726-8a4c-455a-a978-6ee70d66464e%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/20160308084020.GE25061%40konk.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


please tell me the best way to construct a Model of Quiz form

2016-03-08 Thread Jun Tanaka
Hi,

I am trying to make a form for Quizzes. I hope to know how to construct a 
model which be added choices. A model should be constructed by three parts 
as 

Question
the number of right answer
several buttons to choose

for example of a model,
class Quiz(models.Model):
question = models.CharField( max_length=40)
image_url = models.URLField(blank=True, null=True)
correct_ans_num = models.IntegerField(default=1,editable=True)
button1 = models.CharField(help_text=u'button1', max_length=20)
button2 = models.CharField(help_text=u'button2', max_length=20)
button3 = models.CharField(help_text=u'buton3', max_length=20)


But a problem here is the number of buttons i fixed. I prefer to add 
buttons later, and hopefully be able to input data in one admin page.
Please tell me what your best solution of a model should be like. 

Jun



-- 
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/b5380222-7afd-4ffc-a3a7-04864161ec38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.