Re: Timer for online examination

2015-11-16 Thread Robin Lery
Hello,
I think you will  have to implement jquery/javascript to make the timer.
After the countdown finishes js can post the form automatically.

Cheers.

On Tue, Nov 17, 2015 at 1:11 PM, Jani Tiainen  wrote:

> Hi,
>
> If you're looking something magical there isn't anything. Just declare
> expiracy timestamp and compare against it in code. It should be rather
> trivial to do with JS down counter to UI for mode concrete feedback to end
> user.
>
> But keep final word of expiracy in Django code.
>
>
> On 17.11.2015 08:28, Arindam sarkar wrote:
>
> I am developing an online examination website. And having difficulty
> implementing the timer .
> Any one have done it or something related to countdown timer in django ?
>
> --
> Regards,
>
> Arindam
>
> Contact no. 08732822385
>
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/django-users/CAGnF%2BrAAv5DYpPWVxxOGV8%2BsE_w%3DKEhYSnBVArnRTggPuWXfyQ%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/564ADA2D.501%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B4-nGp_1wr-DeObEnrV9GvtpbvcY5hj%2B7R9%2Bqy3n81F6dFHtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Timer for online examination

2015-11-16 Thread Jani Tiainen

Hi,

If you're looking something magical there isn't anything. Just declare 
expiracy timestamp and compare against it in code. It should be rather 
trivial to do with JS down counter to UI for mode concrete feedback to 
end user.


But keep final word of expiracy in Django code.

On 17.11.2015 08:28, Arindam sarkar wrote:
I am developing an online examination website. And having difficulty 
implementing the timer .

Any one have done it or something related to countdown timer in django ?

--
Regards,

Arindam

Contact no. 08732822385


--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGnF%2BrAAv5DYpPWVxxOGV8%2BsE_w%3DKEhYSnBVArnRTggPuWXfyQ%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/564ADA2D.501%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Timer for online examination

2015-11-16 Thread Arindam sarkar
I am developing an online examination website. And having difficulty
implementing the timer .
Any one have done it or something related to countdown timer in django ?

-- 
Regards,

Arindam

Contact no. 08732822385

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGnF%2BrAAv5DYpPWVxxOGV8%2BsE_w%3DKEhYSnBVArnRTggPuWXfyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread Mike Dewhirst

On 17/11/2015 12:33 PM, marcin.j.no...@gmail.com wrote:

  I have no migration directories, so assuming that it would not help


It has just occurred to me that I don't have any unmanaged apps. Maybe 
that is why it worked for me? I seem to remember you need to mark apps 
as unmanaged to switch off migrations.


Mike

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/564AA92C.7050206%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread Mike Dewhirst

On 17/11/2015 12:33 PM, marcin.j.no...@gmail.com wrote:

Mike, thanks. Â I have no migration directories, so assuming that it
would not help.


I just checked and I tested that on 1.8.5

So maybe step 0 is to downgrade and step 4 is to upgrade again.

Cheers

Mike




Tim, also thanks. I've checked that django-dev discussion, but no
updates here.
I don't want to discuss again and again about kicking out useful tools.
Â
It looks like reimplementing old commands is the only way... Thanks.

Marcin

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/4b2803b1-e1aa-4230-a1ee-764751fce16f%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/564A8547.5070502%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread marcin . j . nowak
Mike, thanks.  I have no migration directories, so assuming that it would 
not help.

Tim, also thanks. I've checked that django-dev discussion, but no updates 
here.
I don't want to discuss again and again about kicking out useful tools.
 
It looks like reimplementing old commands is the only way... Thanks.

Marcin

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4b2803b1-e1aa-4230-a1ee-764751fce16f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread Tim Graham
For Django 1.9+, I don't think there's a built-in way to do so. Until that 
feature makes its way into Django (if it ever does), it might not be 
difficult to reimplement those commands to the extent that you need them as 
a third-party app. See 
https://groups.google.com/d/topic/django-developers/h92CcblbYfk/discussion 
for discussion and a start.

On Monday, November 16, 2015 at 8:01:36 PM UTC-5, Mike Dewhirst wrote:
>
> On 17/11/2015 11:14 AM, marcin@gmail.com  wrote: 
> > Hi! 
> > 
> > After upgrade from 1.5 to 1.8.6 I'm trying to dump sql from models. 
> > I'm not using django migrations, and my db_router does not allow for 
> > migrations. 
> > 
>
> Try this ... 
>
> 1. Rename all the migrations directories if they exist 
>
> 2. $~python manage.py sql [appname1] [appname2] > project_[date].sql 
>
> 3. Restore the directory names so they don't get recreated 
>
> Good luck 
>
> > Every "sql*" management command gives me nothing (empty output), where 
> > I'm expecting generated SQL. 
> > 
> >  1. How can I dump tables and indices creation sql from my models with 
> > new Django? 
> >  2. What was wrong with old-style method? 
> > 
> > 
> > Kind Regards, 
> > Marcin 
> > 
> > -- 
> > 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 http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/6f401bdc-dd91-48b4-b8f8-5206db588d76%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/6f401bdc-dd91-48b4-b8f8-5206db588d76%40googlegroups.com?utm_medium=email_source=footer>.
>  
>
> > 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d03cc9ae-27eb-40cc-9c01-49bb3d6fc86f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread Mike Dewhirst

On 17/11/2015 11:14 AM, marcin.j.no...@gmail.com wrote:

Hi!

After upgrade from 1.5 to 1.8.6 I'm trying to dump sql from models.
I'm not using django migrations, and my db_router does not allow for
migrations.



Try this ...

1. Rename all the migrations directories if they exist

2. $~python manage.py sql [appname1] [appname2] > project_[date].sql

3. Restore the directory names so they don't get recreated

Good luck


Every "sql*" management command gives me nothing (empty output), where
I'm expecting generated SQL.

 1. How can I dump tables and indices creation sql from my models with
new Django?
 2. What was wrong with old-style method?


Kind Regards,
Marcin

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/6f401bdc-dd91-48b4-b8f8-5206db588d76%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/564A7C2E.4010005%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


[Django 1.8.6] How to dump sql from models

2015-11-16 Thread marcin . j . nowak
Hi!

After upgrade from 1.5 to 1.8.6 I'm trying to dump sql from models.
I'm not using django migrations, and my db_router does not allow for 
migrations.

Every "sql*" management command gives me nothing (empty output), where I'm 
expecting generated SQL.


   1. How can I dump tables and indices creation sql from my models with 
   new Django?
   2. What was wrong with old-style method?


Kind Regards,
Marcin

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f401bdc-dd91-48b4-b8f8-5206db588d76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANNOUNCE] Django 1.9 release candidate 1 released

2015-11-16 Thread Tim Graham
We're closing in on the final Django 1.9 release, so it's release candidate 
time!

Details are up on the Django project blog:

https://www.djangoproject.com/weblog/2015/nov/16/django-19rc1-released/

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b148f820-d3c7-4ab5-adb3-afc91b02d223%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing redundancy in tests, logged-in vs. not-logged-in

2015-11-16 Thread Carl Meyer
Hi Tim,

On 11/16/2015 01:35 PM, Tim Chase wrote:
> Are there best practices for writing tests where every case has a
> "not logged in" and a "logged in" pairing?  I'm finding myself writing
> too much redundant test-code where the only difference is whether the
> user is anonymous (and thus the test should fail) or logged in with
> appropriate rights (and thus the test should pass).
> 
> For context, this is being run within Django-WebTest as recommended
> to me by Carl Meyer in case it has features I haven't yet encountered
> that would help me.
> 
> Are there best practices to keep these sorts of tests DRY?

Now I'm going to recommend another testing tool: py.test :-)

I handle this type of situation by using py.test parametrization.
Usually I have a bunch of views that are all login-required, so I just
write a single test to check that a view returns redirect-to-login if
accessed anonymously, and then parametrize that test over all the urls
it should apply to. It looks something like this (parametrizing over
just two views):

@pytest.mark.parametrize(
'urlname,urlkwargs',
[('oneview', {}), ('otherview', {'id': 999})],
)
def test_login_required(client, urlname, urlkwargs):
url = reverse(urlname, kwargs=urlkwargs)
resp = client.get(url)

assert utils.redirects_to(resp) == reverse('accounts_login')

I use url-reversing in my tests; the parametrization would be slightly
simpler if you just used raw URLs. The `client` kwarg is a py.test
fixture that returns a WebTest client instance. `utils.redirects_to` is
just a helper that pulls out the `Location` header from the response,
and strips out everything but the path portion.

HTH,

Carl

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/564A414F.4040302%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Reducing redundancy in tests, logged-in vs. not-logged-in

2015-11-16 Thread Tim Chase
Are there best practices for writing tests where every case has a
"not logged in" and a "logged in" pairing?  I'm finding myself writing
too much redundant test-code where the only difference is whether the
user is anonymous (and thus the test should fail) or logged in with
appropriate rights (and thus the test should pass).

For context, this is being run within Django-WebTest as recommended
to me by Carl Meyer in case it has features I haven't yet encountered
that would help me.

Are there best practices to keep these sorts of tests DRY?

Thanks,

-tkc




-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20151116143513.053dd7fa%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


New version of Xapian-Haystack (with Python 3 support)

2015-11-16 Thread Jorge Cardoso Leitão
Hi,

I'm glad to announce Xapian-Haystack 2.0.0
. The main features of
this version are:

- Support for Python 3
- Support for Django 1.8 (>=1.6)
- Support for Xapian 1.3.*
- N(Edge)grams (thanks to ANtlord )

Python 3 requires Xapian 1.3.* and some unix distributions still don't
provide it. Thus, Xapian-Haystack git repository
 has a shell script to
install Xapian on the activated virtualenv. Then `pip install
xapian-haystack`.

Other (development) milestones include:
- deployed TravisCI against different Python, Django and Xapian versions;
- added tests to existing untested code
- deployed coveralls on the test build

Hope you can save some time with it,
Cheers,
Jorge Leitão

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOYPqDCE2a0_%3DeETG0hWa%3DhxRHXkRPBRTz2Xa2dXci8TmDEYZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I let forms.models.ModelChoiceField.queryset relate on request.user?

2015-11-16 Thread Axel Rau
Any idea how to add __init__() to a form class, created by modelform_factory () 
?

Axel

Am 02.11.2015 um 13:50 schrieb Vijay Khemlani :

> At least what I do in those cases is to add a constructor (__init__) to the 
> form class which takes the user as a parameter, modify the choicefield 
> queryset, and then call the original constructor of the form.
> 
> On Sun, Nov 1, 2015 at 3:50 PM, Axel Rau  wrote:
> User should see only choices related to him in a ModelChoiceField.
> Do I need a fresh form per request?
> What would be the best approach?
> 
> Thanks, Axel
> ---
> PGP-Key:29E99DD6  ☀ +49 160 9945 7889  ☀ computing @ chaos claudius
> 
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/728C3EDF-62BB-4450-920B-BB7376417D9C%40Chaos1.DE.
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALn3ei0v3POcwmw9s0beYyGXK15ybwDPooPsYDm%3D1_0XvpStpQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

---
PGP-Key:29E99DD6  ☀ +49 160 9945 7889  ☀ computing @ chaos claudius

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1B5822AC-4F06-4466-8DD0-4996BAC6ABF2%40Chaos1.DE.
For more options, visit https://groups.google.com/d/optout.


Re: Does Django Migration binds data to code?

2015-11-16 Thread João Sampaio
By the way, the 
question: 
http://programmers.stackexchange.com/questions/302682/django-migrations-binds-data-to-code

On Monday, November 16, 2015 at 11:47:40 AM UTC-3, João Sampaio wrote:
>
> Guys, I asked a question in Stack Exchange Programmers about whether 
> Django Migration binds data to code. Can you contribute with your expertise?
> I asked the question over there because anyone can contribute to this 
> discussion, not only Django programmers. :-)
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/58dda80c-1b64-47d2-b49f-3dc493232142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Does Django Migration binds data to code?

2015-11-16 Thread João Sampaio
Guys, I asked a question in Stack Exchange Programmers about whether Django 
Migration binds data to code. Can you contribute with your expertise?
I asked the question over there because anyone can contribute to this 
discussion, not only Django programmers. :-)
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe466b47-21b9-4d1d-91e6-feceff058590%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.