Re: SQL from Model ?

2013-06-01 Thread Russell Keith-Magee
On Sat, Jun 1, 2013 at 11:24 AM, Josueh  wrote:

> hi!
> is possible generate the SQL ("create table/index/") in hardcode?
> example:
> class Book(models.Model):
> title = models.CharField(...)
> price = models.DecimalField(...)
> print django_generate_sql_model( Book )  # <--- here
>
> ??   anyway?  idea?
>

It's certainly possible. After all, Django does it :-)

Depending on what you're trying to achieve, there are a couple of ways.

You can programatically invoke the syncdb command:

$ from django.core.management import call_command
$ call_command('syncdb')

This is exactly the same as calling ./manage.py syncdb from the command line

Alternatively, you can hook into the internals get the SQL that Django uses
to drive the syncdb command. The key code is in
django/core/management/sql.py; you can see how it's called by looking at
django/core/management/commands/syncdb.py. Be warned: this is an
undocumented internal interface. As a result, API consistency isn't
guaranteed between releases. In practice, this doesn't really matter,
because this part of the API is pretty stable, but it's worth keeping in
mind.

The bigger question that needs to be asked, however, is *why* do you want
to dynamically create models in this way. In my experience, this sort of
dynamic model creation is almost always a bad idea, and much better
solutions exist in having a more flexible, but static data model, or by
using a data store more appropriate to the task (e.g., using a
document-based store or a key-value store rather than a relational
database).

Before you spend too much time looking into dynamic model creation, I
*really* encourage you to see if you can model the problem in a different
way.

Yours,
Russ Magee %-)

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




how to import excel file into django models?

2013-06-01 Thread Ali hallaji


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




save data using checkbox click an input

2013-06-01 Thread roopasingh250
Hi,i am using django developing an app.Problem i am facing is i queried a 
list of data from one table and save the same data to another table,but the 
condition is if the user clicks the checkbox and press save.If the checkbox 
is clicked the value(label) of the checkbox should save in database,this is 
my requirement in user level(i explained).I tried with the below code ,

views.py

def what(request):
typeList = Types.objects.filter(user=user, 
is_active=True,parent_type_id=None)
list = []
for type in typeList:
if not type.parent_type_id:
list.append(type)
subtype = Types.objects.filter(parent_type_id=type.id, 
is_active=True)
for subtypes in subtype:
list.append(subtypes)
if request.method == 'POST':
ReportType.objects.filter(report=report).delete()
checked_ones = [unicode(x) for x in subtype if unicode(x) in 
request.POST.keys()]
for entry in checked_ones:
r = ReportType()
r.report = report 
r.title = entry
r.save()
return redirect('/member/where/')
checked_ones = [x.title for x in 
ReportType.objects.filter(report=report)]  
return render(request, 'incident/what.html',{''typeList':list,'})

template is

 {% csrf_token %}
{% for type in typeList%}
 {% if type.parent_type_id == None %}
   {{type.title}}
   {% else %}
   {{type.title}}
  {% endif %}
{% endfor %}


See,i posted all my code to better understand.

Let me tell you the problem i am facing.

1.I am not able to save the data to database,i believe that my view is 
ok,might be some problem with template.

Please help me in do this.

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




pattern validation in QueryDict.get()

2013-06-01 Thread CHI Cheng
In url.py, we could use regex to limit string patterns.

Is there anything similar for QueryDict.get()?

e.g. given

q = request.GET.get(key='q', default=10, *pattern=r'\d+'*)  # new parameter 
pattern

If value of q in //*path?q=xxx* does not match the pattern, then give 
default value.

--
Chi

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




Re: SQL from Model ?

2013-06-01 Thread Josueh
thank you, Russ!  :)

Django is fullstack I want something more simple...
...and I love Django Model!   :)

Im using Tornado(for requests) + Django(for Models)

then... my database model is static, but dont want write SQL for creation 
(create table and create index) manually understand?

call_command("syncdb") dont run... I dont have django application only the 
models   :(

I look core.management.sql django source file but in function "sql_all" exists 
the param "style" ... what is?

very thank Russ!

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




Re: SQL from Model ?

2013-06-01 Thread Josueh
Russ,

call_comman("sqlall", "appname")   runs!!!  :)

the code is:
from django.conf import settings
settings.configure(DATABASES=..., LOGGING_CONFIG=..., 
INSTALLED_APPS=("appname",) )

I only added databases and logging i puts the app ninstalled and run   :)

very very thank 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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: how to import excel file into django models?

2013-06-01 Thread Artem Zinoviev
Django models - it`s ORM to database, and exel is not database it`s only 
zipped xml file. You can convert your .xslt to .csv format and export it in 
db. 

суббота, 1 июня 2013 г., 12:21:33 UTC+3 пользователь Ali hallaji написал:
>
>
>

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




Re: save data using checkbox click an input

2013-06-01 Thread Artem Zinoviev
How you send your form? Checkbox don`t send your form... Why 
you duplicate logic  in views and template? ( 
for type in typeList:
  if not type.parent_type_id: 
***
&& 
 {% for type in typeList%}
  {% if type.parent_type_id == None %} ).
***

P.S. All this code is incorrect. it can`t work.
This is must be here - 

суббота, 1 июня 2013 г., 15:20:57 UTC+3 пользователь roopas...@gmail.com 
написал:
>
> Hi,i am using django developing an app.Problem i am facing is i queried a 
> list of data from one table and save the same data to another table,but the 
> condition is if the user clicks the checkbox and press save.If the checkbox 
> is clicked the value(label) of the checkbox should save in database,this is 
> my requirement in user level(i explained).I tried with the below code ,
>
> views.py
>
> def what(request):
> typeList = Types.objects.filter(user=user, 
> is_active=True,parent_type_id=None)
> list = []
> for type in typeList:
> if not type.parent_type_id:
> list.append(type)
> subtype = Types.objects.filter(parent_type_id=type.id, 
> is_active=True)
> for subtypes in subtype:
> list.append(subtypes)
> if request.method == 'POST':
> ReportType.objects.filter(report=report).delete()
> checked_ones = [unicode(x) for x in subtype if unicode(x) in 
> request.POST.keys()]
> for entry in checked_ones:
> r = ReportType()
> r.report = report 
> r.title = entry
> r.save()
> return redirect('/member/where/')
> checked_ones = [x.title for x in 
> ReportType.objects.filter(report=report)]  
> return render(request, 'incident/what.html',{''typeList':list,'})
>
> template is
> 
>  {% csrf_token %}
> {% for type in typeList%}
>  {% if type.parent_type_id == None %}
>{{type.title}}
>{% else %}
>{{type.title}}
>   {% endif %}
> {% endfor %}
> 
>
> See,i posted all my code to better understand.
>
> Let me tell you the problem i am facing.
>
> 1.I am not able to save the data to database,i believe that my view is 
> ok,might be some problem with template.
>
> Please help me in do this.
>
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: (error) tutorial 2: local admin page not working

2013-06-01 Thread Artem Zinoviev
  Ok. so you have settings of your database... But did you do something for 
enabling admin ? (my answer is Nope.) See your urls.py file (there is a 
comment line - read it closely.) Then go to settings.py file and find 
INSTALLED_APPS dict(in comments here you can read all.) Only after it you 
need run ./manage.py syncdb. 

P.S. use south :-)

суббота, 1 июня 2013 г., 2:20:15 UTC+3 пользователь Issam Laradji написал:
>
> After setting up the database using the command:
>
> "python manage.py syncdb"
>
> I ran "python manage.py runserver" to launch the server
>
> But then when I try open the admin page " http://127.0.0.1:8000/admin/";
>
> I keep getting this error,  
>
>
> Of course, you haven't actually done any work yet. Here's what to do next:
>
>- If you plan to use a database, edit the DATABASES setting in 
>mysite/settings.py.
>- Start your first app by running python manage.py startapp [appname].
>
> You're seeing this message because you have DEBUG = True in your Django 
> settings file and you haven't configured any URLs. Get to work!
>
>
> Thanks in advance...
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: linux or windows

2013-06-01 Thread Artem Zinoviev
Django is a python. And nothing more... if you want be a python developer 
linux is must have. Of course you can develop in windows and play with you 
code some times... But a lot of python package don`t work in windows. if 
you want meet new problem every day - windows is your choice :)

пятница, 31 мая 2013 г., 14:11:23 UTC+3 пользователь Kakar написал:
>
> Hi!
> I know this question is one absurd question, but just out of curiosity, is 
> it important to use linux other than the windows, related to django. Cause 
> i'm in windows, and if it is, then i was thinking to use Ubuntu. Please 
> advise.
>  

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




Re: django , python and ides

2013-06-01 Thread Chris Lawlor
Cool, thank you!

On Friday, 31 May 2013 16:10:12 UTC-4, JoeLinux wrote:
>
> Sure thing :) I'll even give you the stuff that makes my prompt and all 
> that:
>
> $HOME/.bashrc (partial): http://collabedit.com/bnxfx
>
> /bin/postactivate: http://collabedit.com/6bvfr
>
> $HOME/.screenrc-: http://collabedit.com/kuj8d
>
> Enjoy!
>
> --
> Joey "JoeLinux" Espinosa*
> *
>  
> 
>  
>
> On Fri, May 31, 2013 at 2:39 PM, Chris Lawlor 
> 
> > wrote:
>
>> Joey,
>>
>> Would you be interested in sharing your virtualenvwrapper setup? I assume 
>> you're using some custom postactivate hooks, looks nice.
>>
>> Chris
>>
>>
>> On Friday, 31 May 2013 14:23:23 UTC-4, JoeLinux wrote:
>>
>>> I've used both PyCharm and SublimeText extensively for months each at a 
>>> time,
>>>  and I swap back and forth every now and then just to see how the other 
>>> is doing.
>>>
>>> PyCharm:
>>>
>>> Pros vs Sublime:
>>>
>>> - Everything in one package (almost)
>>>
>>> - Debugging capabilities are excellent and built-in
>>>
>>> - 
>>> Virtualenv support and library inspection
>>>
>>> Sublime:
>>>
>>> Pros vs PyCharm:
>>>
>>> - Fast. Fast, fast, fast! Almost every 
>>> shortcut/function/correction/**refactoring/feature 
>>> happens faster in Sublime than PyCharm (sometimes by orders of magnitude)
>>>
>>> - Vintage (Sublime's Vim keymap) is WAY better than IdeaVIM (PyCharm's). 
>>> Vim support is crucial for me.
>>>
>>> - Fonts and colors and animations and basically anything your eyes can 
>>> look at is ten times more pleasing to the eyes than in PyCharm (Java font 
>>> rendering is laughably bad)
>>>
>>>
>>> PyCharm cons:
>>>
>>> - Slow
>>>
>>> - If you quit/close/upgrade/kill while it's indexing, you'll screw it up 
>>> and have to select "Invalidate Caches"
>>>
>>> - Environment variables are not always handled correctly (this will 
>>> really frustrate you sometimes), and you'll have to define them yourself, 
>>> or toss them in your virtualenv's postactivate script
>>>
>>> - Costs $99, with a $59 annual renewal fee
>>>
>>>
>>> Sublime cons:
>>>
>>> - You are responsible for your own environment (this means runserver, 
>>> debugging, etc)
>>>
>>> - Autocompletion does not always work the way you want it to (I've had 
>>> snippets, Emmet, and CodeIntel conflict with each other many times)
>>>
>>> - Costs $70 (though it's a one-time fee, compared to PyCharm... and you 
>>> don't HAVE to pay to use it, as long as you ignore the occasional prompt)
>>>
>>>
>>> One note about Sublime: the first "con" is a big one, because most 
>>> people don't want to set up their development environment in pieces (I felt 
>>> the same way at first). However, over time I've learned to love that very 
>>> aspect, and I appreciate how everything works together better now. I am 
>>> more content now to leave those programs that are good at something to do 
>>> what they're good at, rather than let an IDE like PyCharm do it not-as-good 
>>> (Mercurial support is virtually unusable, for instance). Instead, I've 
>>> grabbed a few tips from around the web, come up with a few of my own, and 
>>> now when I drop to the command line and type "workon ", I'll 
>>> be greeted with a custom prompt, and a GNU Screen session with several open 
>>> (and labeled) windows indicating to me what is available in each one 
>>> (including a runserver, and a Python shell with my virtualenv/Django 
>>> environment loaded and every installed app/model automatically imported). 
>>> Looks something like this:
>>>
>>>
>>> [image: Inline image 1]
>>>
>>> (I blurred a few things out because I'm working on a project that isn't 
>>> public yet)
>>>
>>>
>>> The prompt shows me my user account and computer name, my current 
>>> directory, and my current branch (works on both Mercurial and Git, so I 
>>> don't have to do anything special depending on the scm tool I'm using). A 
>>> little lightning bolt will show up next to the branch name to indicate that 
>>> I have uncommitted changes, which is pretty cool. Also, it's multi-line, so 
>>> I have the entire width of the terminal to work on.
>>>
>>> The bottom bar is my "info bar". It has the name of the project on the 
>>> left (or initials or whatever), then a list of windows and their names, my 
>>> computer name, my system load, the date, and time.
>>>
>>>
>>> So day-to-day, I now use SublimeText pretty much exclusively. Sometimes 
>>> (rarely, but it does happen), I open up PyCharm, but usually only if I 
>>> desperately need to debug Python variables in the middle of rendering a 
>>> Django template. It's pretty good for that. Otherwise, Sublime is amazing.
>>>
>>>
>>> Especially amazing if you watch this video in its entirety and learn 
>>> about SublimeText thoroughly: http://www.**youtube.com/watch?v=TZ-**
>>> bgcJ6fQo 
>>>
>>> HTH
>>>
>>> --
>>> Joey "JoeLinux" Espinosa
>>> Python Developer
>>> h

Re: django , python and ides

2013-06-01 Thread Artem Zinoviev
vim is the best IDE for python/django. Second place i think is for sublime.

пятница, 31 мая 2013 г., 13:54:42 UTC+3 пользователь tony gair написал:
>
> Python and Django are not my first languages and currently I am using it 
> like I would a compiled language inside gedit on debian wheezy. I was 
> actually quite surprised to find a lot of people using it on windows and 
> macs when I went to my local python user group but enough digression!.
>  I was wondering if anyone using debian wheezy can recommend a nice ide 
> (hopefully opensource but if not then relatively inexpenisive) for django 
> and python?
>

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




Re: Django & Ember

2013-06-01 Thread Artem Zinoviev
It`s whery simple. https://github.com/noirbizarre/django-ember.

суббота, 1 июня 2013 г., 8:34:01 UTC+3 пользователь JJ Zolper написал:
>
> Hello,
>
> So I'm thinking about bundling together Django and Ember. The reason is my 
> front end is going to be lots of data in realtime. Think like overlaying a 
> map with information for an example. Lots of data needs to be handled on 
> the front end. Things need to be extremely dynamic.
>
> I love Django and the interface with the database and all that. I'm 
> thinking a powerful solution might be tagging Django and Ember together. 
> Has anyone done this? Anyone have any advice? My questions really are (like 
> the questions on my mind are) like lets say I query the database and get 
> this resulting queryset or list in a variable. In Django you hand that list 
> off to the template. Like I'm not sure how to hand things back and forth 
> between Django and Ember. How I would hand the result from the query to 
> Ember aka JS and then display that to the front end.
>
> Does this sound like a powerful solution for handling large amounts of 
> data? Really any information would be wonderful, better than nothing for 
> sure...
>
> I need high performance and power for processing quickly and giving the 
> users a seamless experience and I'm wondering if this might be the ticket?
>
> Thanks so much,
>
> JJ Zolper
>

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




Re: Bootstrap and Django together at last!

2013-06-01 Thread Artem Zinoviev
did you think about add requirements and README file in project?

среда, 29 мая 2013 г., 0:44:58 UTC+3 пользователь Kevin написал:
>
> Hello everyone!
>
>   I thought I'd provide a recently released Django app I built.  I have 
> listed it on several Django communities including my blog, but I feel it 
> would also be great to everyone if I also provide a link here as well.
>
> https://bitbucket.org/kveroneau/django-bootstrap-theme
>
>   Now your wondering, why should you use this?  Well, it's a Django app!  
> And it makes integrating Bootstrap into your project super easy.  It comes 
> packed with all the Bootstrap example HTML templates in Django template 
> format which you can easily extend into your own project.  There is an 
> example project to display how this is done as well.  There is also a wide 
> variety of templatetags for specifically working with Django templates and 
> bootstrap.  Need to add a bunch of stars on a template to display a rating 
> for a model?  No problem, there's a template filter for that!  Need to 
> create a modal window with as little effort as possible?  Not a problem, 
> use the new modal template block tag and your set!  If you've been using 
> bootstrap with Django before this, you'll immediately want to convert over 
> just because of all the shear helpers included to make using bootstrap in 
> Django so much easier and less stressful!
>
>   The documentation is on my blog post announcing the app itself:
>
>
> http://www.pythondiary.com/blog/May.25,2013/django-bootstrap-theme-ready.html
>
>   It explains all the available "base templates" you can extend, and the 
> available templatetags.
>
> Best Regards,
>   Kevin Veroneau
>   PythonDiary.com
>

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




Re: Bootstrap and Django together at last!

2013-06-01 Thread Artem Zinoviev
https://github.com/nigma/django-modern-template
https://bitbucket.org/danjac/django-bootstrap-template
https://github.com/estebistec/django-twitter-bootstrap
https://github.com/rbrady/django-bootstrapped

and all templates include bootstrap and other things:
https://www.djangopackages.com/grids/g/project-templates/

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




Re: linux or windows

2013-06-01 Thread Kakar Arunachal Service
Thanks!


On Sat, Jun 1, 2013 at 9:04 PM, Artem Zinoviev  wrote:

> Django is a python. And nothing more... if you want be a python developer
> linux is must have. Of course you can develop in windows and play with you
> code some times... But a lot of python package don`t work in windows. if
> you want meet new problem every day - windows is your choice :)
>
> пятница, 31 мая 2013 г., 14:11:23 UTC+3 пользователь Kakar написал:
>
>> Hi!
>> I know this question is one absurd question, but just out of curiosity,
>> is it important to use linux other than the windows, related to django.
>> Cause i'm in windows, and if it is, then i was thinking to use Ubuntu.
>> Please advise.
>>
>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django , python and ides

2013-06-01 Thread Jacky Tedy
I just use Vim

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




Re: Bootstrap and Django together at last!

2013-06-01 Thread Kevin
Hello Artem,

  There are no requirements but Django, and my blog post is essentially the 
README file:
http://www.pythondiary.com/blog/May.25,2013/django-bootstrap-theme-ready.html

  After looking at the packages you provided below, here is my assessment 
on why I created my own based on what these existing ones do.  I have used 
Django bootstrap apps/themes/etc in the past and I literally hated them 
all.  They didn't do what I wanted, or required too much work to get 
working.  My Django app is just that, an app!  Place it in your goddamn 
INSTALLED_APPS and your done!  I've included an example project to show 
just how easy it is to use compared to existing solutions I have seen.

django-modern-template:  The project layout it creates adds a lot of extra 
files, why isn't this an app, why did the developer make it an entire 
project?  I may use it, if I could easily integrate it into existing 
projects.

django-bootstrap-template:  This one comes with it's own "project layout".  
I want something that uses Django as is, not something that I need to use 
an entirely new project layout for.  This package also doesn't include 
Djangofied(is that a real word?) bootstrap example templates to get a 
project up and running very super quickly:
http://twitter.github.io/bootstrap/getting-started.html#examples

In contrast to my new package, it includes every single bootstrap example 
template turned into a "proper" Django template, which can easily be 
extended.  Check out the example project...

django-twitter-bootstrap:  This is better than the previous one, but still 
doesn't include any templates, it merely bundles all the static files into 
a Django app... Not much effort or thought on the developers when putting 
this together.

django-bootstrapped:  I have used this one in the past, I attempted to love 
it... But again, it's missing some key features, such as the bootstrap 
example templates for a quick start.

  This is why most people create their own solution because existing 
solutions don't seem to do what they want out of the box.  It is entirely 
your choice which one of these bootstrap packages you use, I'm not going to 
force you to use any particular package.  This is why open source is great, 
because we as developers have something called "choice".

Best Regards,
  Kevin Veroneau

On Saturday, 1 June 2013 11:17:22 UTC-5, Artem Zinoviev wrote:
>
> https://github.com/nigma/django-modern-template
> https://bitbucket.org/danjac/django-bootstrap-template
> https://github.com/estebistec/django-twitter-bootstrap
> https://github.com/rbrady/django-bootstrapped
>
> and all templates include bootstrap and other things:
> https://www.djangopackages.com/grids/g/project-templates/
>

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




Re: Bootstrap and Django together at last!

2013-06-01 Thread Doug S
Awesome Kevin,
thanks for sharing. Its always fun to learn a new front technology through 
Django awesomeness.
I'm just getting started on Bootstrap so having the beginner 
examples/templates is a nice plus ;-)


On Tuesday, May 28, 2013 5:44:58 PM UTC-4, Kevin wrote:
>
> Hello everyone!
>
>   I thought I'd provide a recently released Django app I built.  I have 
> listed it on several Django communities including my blog, but I feel it 
> would also be great to everyone if I also provide a link here as well.
>
> https://bitbucket.org/kveroneau/django-bootstrap-theme
>
>   Now your wondering, why should you use this?  Well, it's a Django app!  
> And it makes integrating Bootstrap into your project super easy.  It comes 
> packed with all the Bootstrap example HTML templates in Django template 
> format which you can easily extend into your own project.  There is an 
> example project to display how this is done as well.  There is also a wide 
> variety of templatetags for specifically working with Django templates and 
> bootstrap.  Need to add a bunch of stars on a template to display a rating 
> for a model?  No problem, there's a template filter for that!  Need to 
> create a modal window with as little effort as possible?  Not a problem, 
> use the new modal template block tag and your set!  If you've been using 
> bootstrap with Django before this, you'll immediately want to convert over 
> just because of all the shear helpers included to make using bootstrap in 
> Django so much easier and less stressful!
>
>   The documentation is on my blog post announcing the app itself:
>
>
> http://www.pythondiary.com/blog/May.25,2013/django-bootstrap-theme-ready.html
>
>   It explains all the available "base templates" you can extend, and the 
> available templatetags.
>
> Best Regards,
>   Kevin Veroneau
>   PythonDiary.com
>

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




Re: django , python and ides

2013-06-01 Thread Doug Snyder
I use an IDE called Aptana Studio 3 and like it.
I can't say that I've tried a lot of IDEs and I tend to get more
opinionated about programming languages and technologies than editors
but when I got into Django I looked at some options and found Aptana to be
the most full featured free and platform independent option that I could
dig up. Its meant to be a web development IDE so it has some nice
HTML/CSS/JavaScript/JQuery niceities like code coloring, code completion
and things ( which helps me get through the design and onto the important
stuff: Django ). Aptana is built on top of PyDev, the python plugin for
Eclipse ( which has been an opensource standard IDE for a good long time ),
so its got everything python from PyDev and then has a few Django
conveniences built in too, like some common command line django commands
available from the IDE's GUI, and a (i)python shell that loads up your
django environment and lets you do stuff like play with your models to get
them working before you add in extended admin functionality for them or
cook up a proper web interface.
One complaint I have with it is that its a little hard to work with Aptana
Django projects if you are developing them on multiple computers because
the project profile has hard coded paths. The work around is to ignore them
in your version control. One the first computer you start the project with,
Aptana and PyDev will create well formed project meta data file ( one for
each ). You manually copy the new computer and manually edit the hidden
files and change the file paths in the XML to fit the different file
system. It could be worse and I'll probably stop complaining once I write a
script to do it for me.
All around Aptana offers a lot.
I'm believe in simplicity when it comes to programming
When it comes to IDEs I believe in convenience.


On Sat, Jun 1, 2013 at 12:57 PM, Jacky Tedy  wrote:

> I just use Vim
>
> --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django , python and ides

2013-06-01 Thread Doug Snyder
one free one on LInux I'd avoid is SPE IDE - Stani's Python Editor
It's just too old and in the dark ages
I had a lot of problems with encodings and white space/indentation
nightmares when taking my code from it to other editors

If you go with a simple text editor on Linux try Kate,
its got some minimal Python functionality built in like code coloring and
intelligent indentation


On Sat, Jun 1, 2013 at 4:46 PM, Doug Snyder  wrote:

> I use an IDE called Aptana Studio 3 and like it.
> I can't say that I've tried a lot of IDEs and I tend to get more
> opinionated about programming languages and technologies than editors
> but when I got into Django I looked at some options and found Aptana to be
> the most full featured free and platform independent option that I could
> dig up. Its meant to be a web development IDE so it has some nice
> HTML/CSS/JavaScript/JQuery niceities like code coloring, code completion
> and things ( which helps me get through the design and onto the important
> stuff: Django ). Aptana is built on top of PyDev, the python plugin for
> Eclipse ( which has been an opensource standard IDE for a good long time ),
> so its got everything python from PyDev and then has a few Django
> conveniences built in too, like some common command line django commands
> available from the IDE's GUI, and a (i)python shell that loads up your
> django environment and lets you do stuff like play with your models to get
> them working before you add in extended admin functionality for them or
> cook up a proper web interface.
> One complaint I have with it is that its a little hard to work with Aptana
> Django projects if you are developing them on multiple computers because
> the project profile has hard coded paths. The work around is to ignore them
> in your version control. One the first computer you start the project with,
> Aptana and PyDev will create well formed project meta data file ( one for
> each ). You manually copy the new computer and manually edit the hidden
> files and change the file paths in the XML to fit the different file
> system. It could be worse and I'll probably stop complaining once I write a
> script to do it for me.
> All around Aptana offers a lot.
> I'm believe in simplicity when it comes to programming
> When it comes to IDEs I believe in convenience.
>
>
> On Sat, Jun 1, 2013 at 12:57 PM, Jacky Tedy  wrote:
>
>> I just use Vim
>>
>> --
>> 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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django , python and ides

2013-06-01 Thread Doug Snyder
Hey I just ran into a new opensource Python IDE that looks interesting that
wasn't around when I commited to Aptana
Ninja-ide
http://www.ninja-ide.org/
review at:
http://yatharthrock.blogspot.com/2013/01/ninja.html

Has anyone used this yet?



On Sat, Jun 1, 2013 at 4:56 PM, Doug Snyder  wrote:

> one free one on LInux I'd avoid is SPE IDE - Stani's Python Editor
> It's just too old and in the dark ages
> I had a lot of problems with encodings and white space/indentation
> nightmares when taking my code from it to other editors
>
> If you go with a simple text editor on Linux try Kate,
> its got some minimal Python functionality built in like code coloring and
> intelligent indentation
>
>
> On Sat, Jun 1, 2013 at 4:46 PM, Doug Snyder  wrote:
>
>> I use an IDE called Aptana Studio 3 and like it.
>> I can't say that I've tried a lot of IDEs and I tend to get more
>> opinionated about programming languages and technologies than editors
>> but when I got into Django I looked at some options and found Aptana to
>> be the most full featured free and platform independent option that I could
>> dig up. Its meant to be a web development IDE so it has some nice
>> HTML/CSS/JavaScript/JQuery niceities like code coloring, code completion
>> and things ( which helps me get through the design and onto the important
>> stuff: Django ). Aptana is built on top of PyDev, the python plugin for
>> Eclipse ( which has been an opensource standard IDE for a good long time ),
>> so its got everything python from PyDev and then has a few Django
>> conveniences built in too, like some common command line django commands
>> available from the IDE's GUI, and a (i)python shell that loads up your
>> django environment and lets you do stuff like play with your models to get
>> them working before you add in extended admin functionality for them or
>> cook up a proper web interface.
>> One complaint I have with it is that its a little hard to work with
>> Aptana Django projects if you are developing them on multiple computers
>> because the project profile has hard coded paths. The work around is to
>> ignore them in your version control. One the first computer you start the
>> project with, Aptana and PyDev will create well formed project meta data
>> file ( one for each ). You manually copy the new computer and manually edit
>> the hidden files and change the file paths in the XML to fit the different
>> file system. It could be worse and I'll probably stop complaining once I
>> write a script to do it for me.
>> All around Aptana offers a lot.
>> I'm believe in simplicity when it comes to programming
>> When it comes to IDEs I believe in convenience.
>>
>>
>> On Sat, Jun 1, 2013 at 12:57 PM, Jacky Tedy  wrote:
>>
>>> I just use Vim
>>>
>>> --
>>> 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?hl=en.
>>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What to Django people have to say about Javascript frameworks to complement Django's philosophy on the front end

2013-06-01 Thread Doug S
That sounds interesting, I'll definitely check it out and see how I can 
work that into my code.
Are you going to announce it on this list?


On Thursday, April 18, 2013 2:44:03 AM UTC-4, Thomas Weholt wrote:
>
> I've looked at some of the frameworks you mention and I'm by no means a 
> javascript or javascript framework expert, but I'm working on a re-usable 
> app for django which will provide a rich client/server-side API with some 
> glue-code for KnockOutJs, HandbrakeJs etc. It makes it a lot easier to 
> build viewmodels for KnockoutJS, manipulate data client-side and update 
> data server side. The project is not restricted to KnockoutJS, but includes 
> helper routines especially aimed at Knockout and a few other well tested 
> frameworks. 
>
> The goal is not to replace any of the javascript frameworks, but to make 
> it easy for django-apps to create more modern looking and working web pages 
> with as little work as possible. Something like what the 
> django.contrib.admin-package has done for the backend, but for the frontend 
> instead ;-).
>
> It's still pre-alpha, but I'll announce version 0.1 in a short while.
>
>
> On Thu, Apr 18, 2013 at 8:12 AM, Doug Snyder 
> > wrote:
>
>> Another framework I looked at is SproutCore. This seems to be more 
>> focused around widgets like many javascript libraries have been before it. 
>> I'm not sure how extensible these widgets are and how quickly I would run 
>> into limitations of using them for things they weren't specifically 
>> designed for.
>>  
>>
>> On Thu, Apr 18, 2013 at 1:53 AM, Doug S 
>> > wrote:
>>
>>> I hope this is OK to talk Javascript in this Django group, I'm hoping 
>>> its relevant to enough Django folks to not be distracting.
>>> I'm relatively new to Django, but my impression is that a few years ago 
>>> most django people prescribed to the wisdom of keeping javascript to a 
>>> minimum and just using simple JQuery to do simple tasks. Now I think heavy 
>>> Javascript usage is more of reality especially with the shift to more 
>>> mobile web apps, and that the Javascript community is stepping up and 
>>> providing some nice frameworks that can make django people feel a little 
>>> more at home using javascript, more high level frameworks that use MVC 
>>> architecture. I'm starting a few projects where I'll want to essentially 
>>> mirror my django models on the front end to allow editing with out page 
>>> refreshes, front end form validation, and switching between views that are 
>>> downloaded in one request but displayed only according to the state of the 
>>> front end javascript view state. I want nice seemless AJAX communcation 
>>> between the front and back end. I'm aware of a few Javascript libraries 
>>> that are focused around these things and improving javascript web app 
>>> development in general. KnockOutJS caught my eye at first and I did some 
>>> work with that. I found some things worked really fast and really easy, but 
>>> then once I tried more complex things I saw what I think where limitations 
>>> in its extensibility. Since I'm pretty inexperienced with it, I'm not sure 
>>> if this was my lack of experience or deficiencies in the framework. Then I 
>>> found out about Ember,js and it seemed to me like a more complete framework 
>>> ( it tagline is 'Ambitious Web Apps' ) that could probably handle almost 
>>> any situation that I would use it for, although for simple views it 
>>> required a tad more code to be written than KnockOutJS. My first experience 
>>> with Ember last weekend was pretty frustrating, working off what looks like 
>>> the only example in the docs and finding myself buried in errors that were 
>>> entirely foreign to me. This may be beginners luck but I also heard someone 
>>> more experienced express frustration with the learning curve and lack of 
>>> examples in the docs. I've just become aware of a number of Javascript 
>>> libraries that seem to do related things that will be useful for my needs 
>>> above. AngularJS I think is gaining popularity quickly and seems to be 
>>> selling itself as a simple solution that can be extended in any variety of 
>>> ways ( much like django ). I tend to feel good about trusting Google but I 
>>> wonder if what I think is a more structured approach in Ember js is a wiser 
>>> choice for me. I've also read about Spine, which describes itself as a 
>>> simple lightweight MVC framework. Backbone is apparently a library entirely 
>>> concerned with front end data models but not databinding or routing. I 
>>> found a library called Batman intended for Rails but since a Google search 
>>> for django and batman is all about movies and not programming I'm guessing 
>>> no one has adapted this JS lib for django. All of what I'm writing is not 
>>> based on expertise or experience, what I'm really hoping for is some hints 
>>> from django people about what they use or what the pros and cons of the 
>>> different options for javascript frameworks are, a

Re: Django & Ember

2013-06-01 Thread Doug S
Yea, I'm just getting into Django & Ember too.
The django ember app posted above is really just some convenience tags for 
the most part.
I'm not an expert at all on this and I'm probably in about the same place 
as you with this.
My initial feeling is that Ember is just like Django on the front end with 
its MVC and HTML templates and data models.
After begining to learn it its been a little more of a learning curve than 
I thought.
The templating and models are quite similar but the interaction between 
Views and Controllers is a bit different.
RIght now there seem to be too many ways of doing the same thing in Ember 
for me to think too clearly and code without making mistakes,
but that's how django felt at first too.
There's a lot of Javascript MVC frameworks developing and it seems to be 
key in the future of web dev
I think Ember and maybe Backbone have the most momentum behind them ( a 
weakly supported opinion actually )
I think Backbone is supposed to be more simple and clean cut and Ember more 
complete and feature rich.
Obviously in JS MVC your usually storing your models over the wire via 
AJAX, so that's an important part of the technology stack
Ember seems to be developing functionality to make this nice and easy.
If your EMber models are mirror images of your django models AJAX shouldn't 
require much coding
I just noticed that the django ember app has recently added an adaptor to 
TastyPie that should simplify AJAX between the front and back end.
Hopefully the analouge for DJango REST framework is on its way !
The documentation for Ember seems to be improving rapidly too.
here's some video tuts:
http://ember101.com/
But I think django and ember are meant for each other and will grow 
together,
but I wish I knew what I was talking about more. ;-0


On Saturday, June 1, 2013 1:34:01 AM UTC-4, JJ Zolper wrote:
>
> Hello,
>
> So I'm thinking about bundling together Django and Ember. The reason is my 
> front end is going to be lots of data in realtime. Think like overlaying a 
> map with information for an example. Lots of data needs to be handled on 
> the front end. Things need to be extremely dynamic.
>
> I love Django and the interface with the database and all that. I'm 
> thinking a powerful solution might be tagging Django and Ember together. 
> Has anyone done this? Anyone have any advice? My questions really are (like 
> the questions on my mind are) like lets say I query the database and get 
> this resulting queryset or list in a variable. In Django you hand that list 
> off to the template. Like I'm not sure how to hand things back and forth 
> between Django and Ember. How I would hand the result from the query to 
> Ember aka JS and then display that to the front end.
>
> Does this sound like a powerful solution for handling large amounts of 
> data? Really any information would be wonderful, better than nothing for 
> sure...
>
> I need high performance and power for processing quickly and giving the 
> users a seamless experience and I'm wondering if this might be the ticket?
>
> Thanks so much,
>
> JJ Zolper
>

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




Re: Django & Ember

2013-06-01 Thread Doug S
yea, more specifically, I've heard Ember is performant. THe HTML templates 
and style and static media are all loaded once with the app and from there 
its all just AJAX calls for your data. WHen you ask about lots of data, it 
depends what you mean by lots of data. I'm beginning to learn about bid 
data now and the scale of data depends vastly on the application. If your 
Twitter or Facebook they've probably spent years finding a state of the art 
solution using massively parallel processing and very unconventional 
databases.
So it just depends how far down the rabbit hole you want to go ... or need 
to go to get the performance you need. Its best not to over optimize unless 
you need to. But sometimes its hard to predict the future and what scale of 
performance you'll need then. 
On the front end I think ember is quite good for performance, if you're 
doing mapping stuff you'll probably be using HTML5 SVG or Canvas in some 
way, or you could get into WebGL. These technologies would go on top of 
ember. I'm looking at a JAvaScript visualization library called d3.js that 
has a nice connection to python. You can use your GeoDjango on the backend 
and use python's matplotlib on the backend to render some maps. Then d3.js 
has an interface to matplotlib and renders the map on the front end. You 
can also send AJAX data to d3.js on the front end and render stuff that 
updating quickly. So maybe render the background map with matplotlib and d3 
and then send POIs or tracks or whatever it is that your apps needs by some 
JSON representation of the vector graphics to render through d3.js. WebGL 
is a fairly new technology. Most browsers support GPU computing now and I 
think many mobile devices do too ( although they have tiny weak GPUs ). It 
might may an important difference but it may be a rabbit hole if you're not 
farmiliar with OpenGL. It also may not behave terribly robustly on some 
devices or environments.
On the backend django is pretty fast for relational DBs, but Google App 
Engine servers data more quickly. I think App Engine is very quick for 
serving data but slow at storing it. If your map data is mostly 
predeterminedf this might be a good fit. Django models integrates nicely 
with App Engine no I've heard. But for Big Data there are much more 
performant options that are called No-SQL databases. CoachDB is one that's 
good for heirachical data, if you have massive quantities of data, you can 
use technology called Hadoop, Pig and Map Reduce. With massive ammounts of 
data, even simple look ups take some time and these can significantly cut 
that time by using a different strategy than relational DBs. Redis is a 
technology that does very fast computations on the back end. This 
implements some some numerical methods and is basically optimized c code 
that can speed up performance quite a bit for some applications. I wish I 
knew more about these and plan to learn pretty soon.
The good news is that django plays nicely with all these alternative 
backend technologies. Django perfected the relational DB interface just as 
relational DBs became not the only players, but all the new technologies 
have nice integration with python and probably convenience functions for 
django specifically.
Django and Ember is a great backbone to build on, but depending on how much 
you scale you may need to learn other technology on the front and back end.
If you don't know how far your app will go, you can start out with a less 
scalable solution and if you plan right you can introduce the more scalable 
technologies when you learn them or need them. That's the story of the 
company I'm working for right now. And wow, if they had just started out 
with django and ember as the backbone they would have saved a lot of time. 
;-)

Cheers,
Doug

On Saturday, June 1, 2013 1:34:01 AM UTC-4, JJ Zolper wrote:
>
> Hello,
>
> So I'm thinking about bundling together Django and Ember. The reason is my 
> front end is going to be lots of data in realtime. Think like overlaying a 
> map with information for an example. Lots of data needs to be handled on 
> the front end. Things need to be extremely dynamic.
>
> I love Django and the interface with the database and all that. I'm 
> thinking a powerful solution might be tagging Django and Ember together. 
> Has anyone done this? Anyone have any advice? My questions really are (like 
> the questions on my mind are) like lets say I query the database and get 
> this resulting queryset or list in a variable. In Django you hand that list 
> off to the template. Like I'm not sure how to hand things back and forth 
> between Django and Ember. How I would hand the result from the query to 
> Ember aka JS and then display that to the front end.
>
> Does this sound like a powerful solution for handling large amounts of 
> data? Really any information would be wonderful, better than nothing for 
> sure...
>
> I need high performance and power for processing quickly and giving the 
> users

Re: Django & Ember

2013-06-01 Thread Toran Billups
My small software company has a team of 4 python devs and we started using 
ember earlier this year (here are a few things we learned along the way)

1.) use a REST framework to transform your models into JSON over the wire

** We use the latest 2.x of django-rest-framework and it's been great
** If you are into the bleeding edge stuff you could also use ember-data (I 
have an adapter that works with both projects to reduce the $.ajax you 
normally write to communicate with your server on the backend)

https://github.com/toranb/ember-data-django-rest-adapter

2.) you will need a template precompiler that can crunch down your 
handlebars templates

** We use django compressor to minify our JS and CoffeeScript so we just 
added another module called django-ember-precompile

https://npmjs.org/package/django-ember-precompile

3.) If you are a unit testing shop look into ember-testing with QUnit and 
Karma

** The only down side is that Karma does not have a preprocessor built in 
so write your own or wait for my pull request (assuming the core pulls it 
in)

A full example project showing a django app + django rest framework + the 
compressor / handlebars stuff mentioned above

https://github.com/toranb/complex-ember-data-example

Also I'm up for a pairing session or discussion over email if you decide to 
jump in and need some pointers to get started

Toran
tor...@gmail.com

On Saturday, June 1, 2013 12:34:01 AM UTC-5, JJ Zolper wrote:
>
> Hello,
>
> So I'm thinking about bundling together Django and Ember. The reason is my 
> front end is going to be lots of data in realtime. Think like overlaying a 
> map with information for an example. Lots of data needs to be handled on 
> the front end. Things need to be extremely dynamic.
>
> I love Django and the interface with the database and all that. I'm 
> thinking a powerful solution might be tagging Django and Ember together. 
> Has anyone done this? Anyone have any advice? My questions really are (like 
> the questions on my mind are) like lets say I query the database and get 
> this resulting queryset or list in a variable. In Django you hand that list 
> off to the template. Like I'm not sure how to hand things back and forth 
> between Django and Ember. How I would hand the result from the query to 
> Ember aka JS and then display that to the front end.
>
> Does this sound like a powerful solution for handling large amounts of 
> data? Really any information would be wonderful, better than nothing for 
> sure...
>
> I need high performance and power for processing quickly and giving the 
> users a seamless experience and I'm wondering if this might be the ticket?
>
> Thanks so much,
>
> JJ Zolper
>

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




Re: Django & Ember

2013-06-01 Thread Siddharth Shah
Thank you for sharing this information. Much appreciated. 

On Sunday, June 2, 2013 7:00:23 AM UTC+5:30, Toran Billups wrote:
>
> My small software company has a team of 4 python devs and we started using 
> ember earlier this year (here are a few things we learned along the way)
>
> 1.) use a REST framework to transform your models into JSON over the wire
>
> ** We use the latest 2.x of django-rest-framework and it's been great
> ** If you are into the bleeding edge stuff you could also use ember-data 
> (I have an adapter that works with both projects to reduce the $.ajax you 
> normally write to communicate with your server on the backend)
>
> https://github.com/toranb/ember-data-django-rest-adapter
>
> 2.) you will need a template precompiler that can crunch down your 
> handlebars templates
>
> ** We use django compressor to minify our JS and CoffeeScript so we just 
> added another module called django-ember-precompile
>
> https://npmjs.org/package/django-ember-precompile
>
> 3.) If you are a unit testing shop look into ember-testing with QUnit and 
> Karma
>
> ** The only down side is that Karma does not have a preprocessor built in 
> so write your own or wait for my pull request (assuming the core pulls it 
> in)
>
> A full example project showing a django app + django rest framework + the 
> compressor / handlebars stuff mentioned above
>
> https://github.com/toranb/complex-ember-data-example
>
> Also I'm up for a pairing session or discussion over email if you decide 
> to jump in and need some pointers to get started
>
> Toran
> tor...@gmail.com 
>
> On Saturday, June 1, 2013 12:34:01 AM UTC-5, JJ Zolper wrote:
>>
>> Hello,
>>
>> So I'm thinking about bundling together Django and Ember. The reason is 
>> my front end is going to be lots of data in realtime. Think like overlaying 
>> a map with information for an example. Lots of data needs to be handled on 
>> the front end. Things need to be extremely dynamic.
>>
>> I love Django and the interface with the database and all that. I'm 
>> thinking a powerful solution might be tagging Django and Ember together. 
>> Has anyone done this? Anyone have any advice? My questions really are (like 
>> the questions on my mind are) like lets say I query the database and get 
>> this resulting queryset or list in a variable. In Django you hand that list 
>> off to the template. Like I'm not sure how to hand things back and forth 
>> between Django and Ember. How I would hand the result from the query to 
>> Ember aka JS and then display that to the front end.
>>
>> Does this sound like a powerful solution for handling large amounts of 
>> data? Really any information would be wonderful, better than nothing for 
>> sure...
>>
>> I need high performance and power for processing quickly and giving the 
>> users a seamless experience and I'm wondering if this might be the ticket?
>>
>> Thanks so much,
>>
>> JJ Zolper
>>
>

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




Re: Using multiple model files per app with the Improved Multiple Model Files Django Snippet

2013-06-01 Thread Doug S
Awesome, thanks, I love python but I am not (yet) skilled at the art of 
incantation.
The snippet above: http://djangosnippets.org/snippets/1838/
did have some incantation but the post was fairly old in terms of 
django/python's history.
I can't tell one incantation from another but I can tell a django app that 
fails to sync from one that does.
If anybody has trouble with this kind of django project structure,
Mike's incantation works just right, I don't want to be as bold as to say 
the one in the snippet
doesn't work, but I couldn't get it to work.

if its not already clear heres my set up:

#my_project

#manage.py

#settings.py

#myapp/

#models/#__init__.py#models1.py#
models2.py

--
in __init__.py:
# incantation 
from __future__ import absolute_import 
from .models1 import ModelOne 
from .models2 import ModelTwo
--
in models1.py:
from myapp.models import Model2
--
in models2.py:
from myapp.models import Model1
--
in admin.py:
from my_app.models import Model1, Model2

I also took a precaution that I'm not sure was required:
I made sure Django knew which app to put all my Model1 & Model2 in
by defining a Meta property like this:

class Meta:

app_label = 'myapp'


On Thursday, May 30, 2013 8:43:46 AM UTC-4, Doug S wrote:
>
> I'm trying to use multiple files for my models in a single app.
> I found a nice solution on Django Snippets :
> http://djangosnippets.org/snippets/1838/
> but I'm not able to get it to work.
> The docs assume that I know more than I do about how this solution works.
> Its involves using a models folder for the app like this:
>
> # myapp/#   models/# __init__.py# models1.py# models2.py
>
>
> and then including an __init__.py file in the folder to make it a package
>
> this file also contains this code:
>
> import django.db.modelsimport sys 
> appname = "myapp"from models1 import *from models2 import *
> __all__ = []   
> for decl in globals().values(): 
>   try:
> if decl.__module__.startswith(__name__) and issubclass(decl, 
> django.db.models.Model):
>   decl._meta.db_table = decl._meta.db_table.replace('models', appname)
>   decl._meta.app_label = appname   
>   __all__.append(decl.__name__)
>   django.db.models.loading.register_models(appname, decl)
>   except:
> pass
>
> I don't understand this code, but hopefully I don't have to.
>
> I just want to be able to import my individual model modules:
>
> models1.py & models2.py
>
> from my views and admin.py
>
> the import statements are not included in the snippet
>
> and I've tried what seems reasonable and keep getting errors importing the 
> modules saying they don't exist
>
> I would expect you do something like
>
> import myapp.models.model1
>
> &
>
> import myapp.models.model2*
> *
>
> but this doesn't work.
>
> maybe I don't understand the magic in the __init__.py file
>
> or I'm just being plain stupid.
>
> Can someone point me toward getting this solution working with my imports?
>
>

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