Re: Workflow/tools assistance

2013-09-12 Thread Sayth Renshaw
On Friday, September 13, 2013, Thomas Lockhart wrote:

>  On 9/12/13 6:44 AM, Sayth Renshaw wrote:
>
>
>
> On Thursday, September 12, 2013, Germán Larraín wrote:
>
>> Some comments:
>>
>> * why use sqlalchemy if Django has its own ORM?
>> * you mentioned parsing SQL entries; watch out!
>> * if you are starting a new project, I seriously recommend you to use
>> PostreSQL, not MySQL/Maria DB
>>
>  +1
>
> I was just googling for methods and examples of how people do this. Of the
> very  scarce info out there Sqlalchemy was in it.
>
> That would be a red herring.
>
>
>  In the django docs it has initial fixtures.
>
>
> https://docs.djangoproject.com/en/1.2/howto/initial-data/#providing-initial-data-with-fixtures
>
>  But this doesn't seem to provide the functionality of loading recurring
> data via XML data thru ORM to database.
>
>  I would write a python script to stuff it in to the database directly or
> if you want others to be able to upload files to be read in then integrate
> an upload capability with some backend python code. If the files are large
> then you will want to have a separate thread do the work. And if the files
> need validation you may want to break this into two pieces so the file is
> uploaded and the file name is stashed in a model, then another thread or
> cron job can pick it up and do some processing, maybe keeping track of the
> status in the database also.
>
> For a separate python script you may need to write some simple SQL, but
> for the django portions you would not need to touch that.
>
> Write your models for the dataflow you need, then fill in the other pieces
> with some code.
>
> hth
>
>  - Tom
>
>
>
Users won't need to upload scripts, I would be updating with about 4 XML
files per week.  Users could add info or update info to specified fields
only.

I then want the users to be able to interact with interactive graphs based
on the data.

Thanks for the feedback

Sayth

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


check form field class

2013-09-12 Thread Ariel Calzada
hi all.

I'm parsing a form in a template with {% for field in form %} .. {%
endfor %} i want to ask if field is a FileField instance any idea?

-- 
Ariel Calzada
Homepage: http://www.000paradox000.com
Blog: http://blog.000paradox000.com

"If I had asked people what they wanted, they would have said faster
horses."

 -- Henry Ford

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Workflow/tools assistance

2013-09-12 Thread Thomas Lockhart

On 9/12/13 6:44 AM, Sayth Renshaw wrote:



On Thursday, September 12, 2013, Germán Larraín wrote:

Some comments:

* why use sqlalchemy if Django has its own ORM?
* you mentioned parsing SQL entries; watch out!
* if you are starting a new project, I seriously recommend you to
use PostreSQL, not MySQL/Maria DB


+1
I was just googling for methods and examples of how people do this. Of 
the very  scarce info out there Sqlalchemy was in it.

That would be a red herring.


In the django docs it has initial fixtures.

https://docs.djangoproject.com/en/1.2/howto/initial-data/#providing-initial-data-with-fixtures

But this doesn't seem to provide the functionality of loading 
recurring data via XML data thru ORM to database.


I would write a python script to stuff it in to the database directly or 
if you want others to be able to upload files to be read in then 
integrate an upload capability with some backend python code. If the 
files are large then you will want to have a separate thread do the 
work. And if the files need validation you may want to break this into 
two pieces so the file is uploaded and the file name is stashed in a 
model, then another thread or cron job can pick it up and do some 
processing, maybe keeping track of the status in the database also.


For a separate python script you may need to write some simple SQL, but 
for the django portions you would not need to touch that.


Write your models for the dataflow you need, then fill in the other 
pieces with some code.


hth

 - Tom

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Appointment App

2013-09-12 Thread C. Kirby
I haven't used any of these but some quick googling found

   - django-schedule 
   - django-booking 
   - django-reservations 

One of those might get you started

On Thursday, September 12, 2013 8:34:02 AM UTC-5, Hasil Sharma wrote:
>
> Hello Everyone,
>
> I wish to make an online appointment booking app for my start up. I don't 
> want to start programming from the scratch. Does any django app already 
> exists that might help me ?
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Appointment App

2013-09-12 Thread Hasil Sharma
Hello Everyone,

I wish to make an online appointment booking app for my start up. I don't 
want to start programming from the scratch. Does any django app already 
exists that might help me ?

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Workflow/tools assistance

2013-09-12 Thread Sayth Renshaw
On Thursday, September 12, 2013, Germán Larraín wrote:

> Some comments:
>
> * why use sqlalchemy if Django has its own ORM?
> * you mentioned parsing SQL entries; watch out!
> * if you are starting a new project, I seriously recommend you to use
> PostreSQL, not MySQL/Maria DB
>
> -
>

Hi
 why use sqlalchemy if Django has its own ORM?

I was just googling for methods and examples of how people do this. Of the
very  scarce info out there Sqlalchemy was in it.

In the django docs it has initial fixtures.


https://docs.djangoproject.com/en/1.2/howto/initial-data/#providing-initial-data-with-fixtures

But this doesn't seem to provide the functionality of loading recurring
data via XML data thru ORM to database.

Sayth

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django/dajax

2013-09-12 Thread C. Kirby
I would suggest trying the dajax mailing list for app specific help: 
https://groups.google.com/forum/#!forum/dajaxproject

On Thursday, September 12, 2013 4:28:36 AM UTC-5, MikeKJ wrote:
>
> I simply want to populate a drop select based on what was selected in a 
> previous drop select box I found a dajax/dajaxice method but it does not 
> seem to trigger any clues please?
>
> views.py
>
> from dajax.core import Dajax
> from dajaxice.decorators import dajaxice_register
>
> @dajaxice_register
> def updatecombo(request, option):
> dajax = Dajax()
> options = TopicChoices.objects.all().filter(theme=option)
> out = []
> #for option in options[int(option)]:
> for opt in options:
> out.append("%s" % opt)
> dajax.assign('#combo2', 'innerHTML', ''.join(out))
> return dajax.json()
>
>
> search.html
> Please select
> {% for x in form.adv_choices %}
>  %} selected="selected"{% endifequal %}>{{ x.title }}
> {% endfor %}
> 
> 
> 
>
> I don't get any errors just no population of "combo2"
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Reliable and cheap hosting for simple webapp in Django

2013-09-12 Thread Germán Larraín
Also

https://www.nitrous.io

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: error python manage.py syncdb

2013-09-12 Thread Germán Larraín
Never import Django stuff in your settings (except core.exceptions) unless you 
REALLY know what you are doing

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


I cannot enable logging in server console

2013-09-12 Thread Germán Larraín
Perhaps it's a pycharm issue...

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Workflow/tools assistance

2013-09-12 Thread Germán Larraín
Some comments:

* why use sqlalchemy if Django has its own ORM?
* you mentioned parsing SQL entries; watch out!
* if you are starting a new project, I seriously recommend you to use 
PostreSQL, not MySQL/Maria DB

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Installing django dev

2013-09-12 Thread Germán Larraín
If you are using a virtualenv I don't see why you need to use "sudo".

Where did you clone the git repo? Do you have the "regular" permissions in that 
directory?

Also, consider reading the dev version of the docs, not 1.5 (like the link you 
referenced).

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Newbie] Self referencing models

2013-09-12 Thread Xavier Ordoquy
Hello Zoubeida,

models.ForeignKey(self) works (see 
https://docs.djangoproject.com/en/1.5/ref/models/fields/#foreignkey about it).

What sort of error did you get when trying it ?

Regards,
Xavier Ordoquy.


Le 12 sept. 2013 à 09:44, Zoubeida  a écrit :

> Any help?
> 
> Le samedi 8 novembre 2008 07:58:00 UTC+1, sunn a écrit :
> How do I make a foreign key to self? 
> 
> class Page(models.Model): 
> title = models.CharField(max_length=128) 
> display = models.CharField(max_length=64) 
> path = models.CharField(max_length=64) 
> sortorder = models.IntegerField() 
> parent = models.OneToOneField(Page) #Will not work neither will 
> parenttest = models.ForeignKey(Page) #nor 
> parenttest2 = models.ForeignKey(self) 
> def __unicode__(self): 
> return self.display 
> 
> any help appreciated! 
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Newbie] Self referencing models

2013-09-12 Thread Masklinn
On 2013-09-12, at 09:44 , Zoubeida wrote:
> Any help?
> 
> Le samedi 8 novembre 2008 07:58:00 UTC+1, sunn a écrit :
>> 
>> How do I make a foreign key to self? 
>> 
>> class Page(models.Model): 
>>title = models.CharField(max_length=128) 
>>display = models.CharField(max_length=64) 
>>path = models.CharField(max_length=64) 
>>sortorder = models.IntegerField() 
>>parent = models.OneToOneField(Page) #Will not work neither will 
>>parenttest = models.ForeignKey(Page) #nor 
>>parenttest2 = models.ForeignKey(self) 
>>def __unicode__(self): 
>>return self.display 
>> 
>> any help appreciated! 

The official documentation? 
https://docs.djangoproject.com/en/1.6/ref/models/fields/#foreignkey

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Newbie] Self referencing models

2013-09-12 Thread Zoubeida
Any help?

Le samedi 8 novembre 2008 07:58:00 UTC+1, sunn a écrit :
>
> How do I make a foreign key to self? 
>
> class Page(models.Model): 
> title = models.CharField(max_length=128) 
> display = models.CharField(max_length=64) 
> path = models.CharField(max_length=64) 
> sortorder = models.IntegerField() 
> parent = models.OneToOneField(Page) #Will not work neither will 
> parenttest = models.ForeignKey(Page) #nor 
> parenttest2 = models.ForeignKey(self) 
> def __unicode__(self): 
> return self.display 
>
> any help appreciated! 
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Workflow/tools assistance

2013-09-12 Thread Sayth Renshaw
I have been learning the basics of django, SQL, XML and MySQL / Maria.db.

Trying to design a project and I can't get a concept of how to achieve it. 
Looking for some guidance in tools or process to achieve it.

There is one specific part that trips me up. Whilst I can parse a basic SQL 
file, read csv files, put a file to a database these are all based off simple 
examples.

What I need to do is take an XML file, parse it and split it into 3 related 
tables and update the entries into my database.

It is these entries that the app will view, have details added and updated and 
calculated.

The tools in examples are lxml, sqlalchemy, matplotlib for graphing.

How in django do I make this happen ? What should I read more on?

I am sure people do this all the time.

Sayth

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


django/dajax

2013-09-12 Thread MikeKJ
I simply want to populate a drop select based on what was selected in a 
previous drop select box I found a dajax/dajaxice method but it does not 
seem to trigger any clues please?

views.py

from dajax.core import Dajax
from dajaxice.decorators import dajaxice_register

@dajaxice_register
def updatecombo(request, option):
dajax = Dajax()
options = TopicChoices.objects.all().filter(theme=option)
out = []
#for option in options[int(option)]:
for opt in options:
out.append("%s" % opt)
dajax.assign('#combo2', 'innerHTML', ''.join(out))
return dajax.json()


search.html
Please select
{% for x in form.adv_choices %}
{{ x.title }}
{% endfor %}




I don't get any errors just no population of "combo2"

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: SimpleLazyObject for request.user not correctly evaluated inside RequestContext

2013-09-12 Thread giovanni allegri
Hi German,
thanks for the reply. I apologize for the delay, but I didn't receive the 
notification :(
I've definetly improved the form workflow defining a validator inside my 
form. My validator check avoids the IntegrityError from Postgres.

Anyway, in case such an error happens, how should one manage it? How to 
reference the current transaction to roll it back?

giovanni

Il giorno sabato 7 settembre 2013 04:02:03 UTC+2, Germán Larraín ha scritto:
>
> What DB engine are you using? If it is PostgreSQL, you need to roll back 
> the transaction after a database error exception (e.g. IntegrityError).
>
> By the way, I think what you are doing is wrong. If the form data is 
> invalid, then you need to call . form_invalid
>
> On Friday, September 6, 2013 11:41:34 AM UTC-5, giovanni allegri wrote:
>>
>> I've opened a new thread, which relates to a previous 
>> onefrom me.
>> Digging into a wired behaviour in a FormView I've arrived to the 
>> following problem:
>>
>>  - In my "form_valid" method I need to manage exceptions situations.
>>  - In case of an exception I want to pass the response flow to an 
>> external method, in an other module
>>  - This external method returns a "render_to_response", in which I also 
>> pass a RequestContext instance built from the "FormView.request" object.
>>
>> Sometihng like this (I past a simplified version)
>>
>> class ProjectCreateView(FormView):
>>
>> def form_valid(self, form):
>> try:
>> 
>> except IntegrityError as e:
>> return render_error(_('A project with the same title already 
>> exists'),self.request)
>>
>> def render_error(msg,request):
>> #__dummy__ = request.user.is_authenticated()
>> data = {'error':{'msg':msg}}
>> return 
>> render_to_response('generic_error.html',data,context_instance=RequestContext(request))
>>
>> This causes a DatabaseError, because it crashes when it reaches the 
>> user.is_authenticated template variable. The crashed seems to be caused 
>> because of the SimpleLazyObject around the User instance. It seems it's not 
>> correctly setup, or whatelse... I don't know.
>>
>> This problem disappears if I use the __dummy__ variable in the previous 
>> snippet.
>> This call seems to make the SimpleLazyObject "prepared" for later calls 
>> (within the context processors).
>>
>> Why does this happen???
>> It never happens in other view and generic views I'm using in my project. 
>> What's wrong with the form view?
>>
>> Notice that 
>>
>> 1 - the same happens even if I set self.template_name and call 
>> self.render_to_response.
>> 2 - it doesn't happen during the normal form view workflow
>>
>> Giovanni
>>
>>
>>
>>
>>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.