ModelAdmin Media assets with django 1.8

2020-06-11 Thread Amirouche Boubekki
Using Django 1.8, I do not understand what is the behavior of `Media` [0] 
inside a `ModelAdmin` subclass.

In particular, whether the default behavior of form's media is applied in 
`ModelAdmin` that is: `extend=True` [1]

I am under the impression that the behavior is implemented in 
`options.ModelAdmin.media` property [2], maybe there is more to it than 
that since it has a custom metaclass.


Thanks in advance !

[0] 
https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#modeladmin-asset-definitions
[1] https://docs.djangoproject.com/en/1.8/topics/forms/media/#extend
[2] 
https://github.com/django/django/blob/6a0dc2176f4ebf907e124d433411e52bba39a28e/django/contrib/admin/options.py#L636-L649

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1235108b-e561-4866-970e-f899c3c3acf3o%40googlegroups.com.


[ANN] copernic v0.1.1, Versioned structured data, with change-request mechanic, at scale.

2020-02-23 Thread Amirouche Boubekki
I am pleased to announce the immediate availability of copernic v0.1.1.

This project wants to be a scalable application that support a 
change-request
mechanic similar to github pull-request or gitlab merge-request, on any
structured data.  That includes relational data, graph-like data and tabular
data.  Eventually, it should scale both in terms of data size and number of 
contributions.

Like wikipedia or wikidata, there is a single version of truth. In other 
words, 
every user gets the same data, there is no micro per user data repositories.

Change-request work in a way that similar to git stash, that is the diff, 
additions 
and deletions, is stored in the database like the rest of the data.  Until 
the change
is applied by a super user, the data part of the change-request is 
invisible outside
the change request.

Once a super user applies the change, that is merely swapping a single 
`None` 
value with a timestamp, the history is properly serialized realizing a 
single
branch history.

It it possible to do time traveling queries, like freebase did. It is not 
exposed in 
the web user interface.

There is always an up-to-date image of the latest data, to speed up 
queries. 
But the history only store the differences between successive versions.

The code is at: https://github.com/amirouche/copernic

A demo is available at: http://copernic.space/about/

The license is AGPLv3+

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e962b09-4378-4b50-abbd-afd0c8c97415%40googlegroups.com.


Re: [ANN] copernic v0.0.0

2020-02-19 Thread Amirouche Boubekki


On Monday, February 17, 2020 at 11:13:38 PM UTC+1, Amirouche Boubekki wrote:
>
> I am very pleased to announce that I will work on porting my work on a 
> versioned database (read: scalable wikidata) to Python and Django.
>
> If you want to know more and follow the development watch this: 
> https://github.com/amirouche/copernic
>


I put together the basic building blocks: generic tuple store and the 
versioned generic tuple store. The tests pass, however the absence of 
proof, is not the proof of the absence, so there might be bugs. Anyway, I 
added two issues:

- How to convert wordnet rdf into the format that will be accepted by 
copernic: https://github.com/amirouche/copernic/issues/11

- Another one about more about how the versioned and change request happen: 
https://github.com/amirouche/copernic/issues/10

It is still no possible to add changes from the web ui, but here is some 
screenshot: https://functional.cafe/@zig/103686859595640820

This project has the power the change the "Quatery industry" also known as 
the knowledge industry.  The gist of the idea I want to demonstrate is how 
to apply the pull-request mechanic on any structured data.  That idea, is 
applied directly to the creation and maintenance of a knowledge base, but 
it could be applied on most or any B2B or B2C products.

The installation on at least on ubuntu 18.04, is straight forward, follow 
the instructions at: https://www.foundationdb.org/download/#ubuntu

Then pip install -r requirements.txt

And the rest is usual django stuff. I recommend you read nstore.py and 
vnstore.py. The UI is defined in frontend app.

Happy hacking!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ef0df90-daf8-4107-884e-d021c7fb6777%40googlegroups.com.


[ANN] copernic v0.0.0

2020-02-17 Thread Amirouche Boubekki
I am very pleased to announce that I will work on porting my work on a 
versioned database (read: scalable wikidata) to Python and Django.

If you want to know more and follow the development watch this: 
https://github.com/amirouche/copernic



Cheers,


Amirouche ~ https://hyper.dev

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8f0fa8d2-a0d0-4345-95e2-931d6b8a87c4%40googlegroups.com.


Re: File upload error

2015-02-25 Thread Amirouche Boubekki
Héllo again (at last)

On Mon, Feb 16, 2015 at 11:20 AM Sola Chong  wrote:

> I having a error "*expected string or buffer*" when submit to upload
> avatar when edit profile. Can't figure out what is the problem..
>



I've setup a small project with your code (and small modifications) using
django 1.7 and python 2.7.8 (it's important to provide that infos).

I did not reproduce the error.

I describe below what I changed or can be changed:



>
> *Model:*
> class MyProfile(models.Model):
> user = models.ForeignKey(User)
> dob = models.DateField(null=True, blank=True)
> address = models.CharField(max_length=100, blank=True)
> contact = models.CharField(max_length=50, blank=True)
> bio = models.TextField(blank=True)
> avatar_url = FileField(_("Avatar"), max_length=200, format="Image",
>  upload_to='user/avatar', blank=True)
> banner_url = FileField(_("Cover"), max_length=200, format="Image",
>  upload_to='user/cover', blank=True)
> created = models.DateTimeField(auto_now_add=True)
> last_modified = models.DateTimeField(auto_now=True)
>

- There is no "format" parameter in FileField constructor.
- it's better to stay consistent regarding the model fields and use
models.FileField instead of FileField alone. If FileField is a custom
class, it should have another name.
- User model is referenced directly. You can live with that. It can break
in some situations cf.
https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#referencing-the-user-model


> *Forms:*
> class UserModelForm(forms.ModelForm):
> class Meta:
> model = User
> fields = ('first_name', 'last_name', 'email')
> widgets = {
> 'email': forms.TextInput(attrs={'readonly':'readonly'}),
> }
>
>
> class UserProfileModelForm(forms.ModelForm):
> dob = forms.DateField(widget=forms.DateInput(format = '%d/%m/%Y'),
>input_formats=('%d/%m/%Y',),
>required=True, help_text='dd/mm/')
> avatar_url = forms.FileField()
>
> class Meta:
> model = MyProfile
> fields = ('dob', 'address', 'contact', 'bio', 'avatar_url')
>
>
> *Views:*
> def editProfileView(request, template="controlpanel/cp_edit_profile.html"
> ):
>
> myprofiles = MyProfile.objects.all()
> myprofile = get_object_or_404(myprofiles, user=request.user)
>
> if request.method == "POST":
> form = UserProfileModelForm(request.POST, request.FILES, instance=
> myprofile)
> userForm = UserModelForm(request.POST, request.FILES, instance=
> request.user)
>
> if form.is_valid() and userForm.is_valid():
> user = userForm.save()
> profile = form.save(commit = False)
> profile.user = user
> profile.save()
>
>
> info(request, _("Successfully Edit"))
> else:
> userForm = UserModelForm(instance=request.user)
> form = UserProfileModelForm(instance=myprofile)
>
>
> context = {"cpprofile": myprofile, 'userForm':userForm, 'form':form}
>
> return render(request, template, context)
>
> *Template:*
> 
> 
> {{ title }}
> {% fields_for userForm %}
> {% fields_for form %}
> 
> {% block account_form_actions %}
>  "submit" value="Submit">
> {% endblock %}
> 
> 
> 
>
>
I don't know {% fields_for %} tag. I used {{ userForm.as_ul }} instead.

If you are interested, I can push the code online.


HTH

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


Re: File upload error

2015-02-16 Thread Amirouche Boubekki
Héllo Sola,


Can you post the full stacktrace not only the error?


Regards

On Mon Feb 16 2015 at 11:20:42 AM Sola Chong  wrote:

> I having a error "*expected string or buffer*" when submit to upload
> avatar when edit profile. Can't figure out what is the problem..
>
> *Model:*
> class MyProfile(models.Model):
> user = models.ForeignKey(User)
> dob = models.DateField(null=True, blank=True)
> address = models.CharField(max_length=100, blank=True)
> contact = models.CharField(max_length=50, blank=True)
> bio = models.TextField(blank=True)
> avatar_url = FileField(_("Avatar"), max_length=200, format="Image",
>  upload_to='user/avatar', blank=True)
> banner_url = FileField(_("Cover"), max_length=200, format="Image",
>  upload_to='user/cover', blank=True)
> created = models.DateTimeField(auto_now_add=True)
> last_modified = models.DateTimeField(auto_now=True)
>
> *Forms:*
> class UserModelForm(forms.ModelForm):
> class Meta:
> model = User
> fields = ('first_name', 'last_name', 'email')
> widgets = {
> 'email': forms.TextInput(attrs={'readonly':'readonly'}),
> }
>
>
> class UserProfileModelForm(forms.ModelForm):
> dob = forms.DateField(widget=forms.DateInput(format = '%d/%m/%Y'),
>input_formats=('%d/%m/%Y',),
>required=True, help_text='dd/mm/')
> avatar_url = forms.FileField()
>
> class Meta:
> model = MyProfile
> fields = ('dob', 'address', 'contact', 'bio', 'avatar_url')
>
>
> *Views:*
> def editProfileView(request, template="controlpanel/cp_edit_profile.html"
> ):
>
> myprofiles = MyProfile.objects.all()
> myprofile = get_object_or_404(myprofiles, user=request.user)
>
> if request.method == "POST":
> form = UserProfileModelForm(request.POST, request.FILES, instance=
> myprofile)
> userForm = UserModelForm(request.POST, request.FILES, instance=
> request.user)
>
> if form.is_valid() and userForm.is_valid():
> user = userForm.save()
> profile = form.save(commit = False)
> profile.user = user
> profile.save()
>
>
> info(request, _("Successfully Edit"))
> else:
> userForm = UserModelForm(instance=request.user)
> form = UserProfileModelForm(instance=myprofile)
>
>
> context = {"cpprofile": myprofile, 'userForm':userForm, 'form':form}
>
> return render(request, template, context)
>
> *Template:*
> 
> 
> {{ title }}
> {% fields_for userForm %}
> {% fields_for form %}
> 
> {% block account_form_actions %}
>  "submit" value="Submit">
> {% endblock %}
> 
> 
> 
>
>
> Thank you 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c34f91dc-20a8-4195-ba8d-134287e1f9ae%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/CAL7_Mo8weKby069OsM9s2nUu9Zr61N8%2BLYLO01smCese-s%2Bo7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django for latex

2015-01-23 Thread Amirouche Boubekki
On Fri Jan 23 2015 at 1:28:13 PM Hitesh Sofat  wrote:

> I want to generate pdf using latex. Please guide me for this , anybody
> having any tutorial please share it here.
>

You might be interested by weasyprint . It can
generate pdf from html documents.

It seems like there some django for it
https://github.com/dekkers/django-weasyprint.

HTH

-- 
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/CAL7_Mo_FxeWZ1kBbKzkPF8CTaA62F%2BVXJ3NNbdLjs%2BD57%3Dpatg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Guidance needed - Real time and django

2014-09-02 Thread Amirouche Boubekki
2014-09-02 18:15 GMT+02:00 Robin Lery <robinl...@gmail.com>:

> Thank you Amirouche! I will surely look onto that. And I saw many
> tutorials on django + node.js and socket.io, and was just curious as to
> what your thoughts are on this as the new version of socket.io has also
> been released?
>

I will look at the new version, later.

Last time I tried it, I didn't grasp the interest of it, except providing
fallbacks for browser that did not support websockets. Which probably means
that you need a specific code in the backend to support those...

Checkout the documentation of gevent-socketio
<https://github.com/abourget/gevent-socketio/blob/master/docs/source/index.rst>
at some point there was a wrapper for django.


>
> On Mon, Sep 1, 2014 at 3:09 AM, Amirouche Boubekki <
> amirouche.boube...@gmail.com> wrote:
>
>> Hello,
>>
>>
>> 2014-08-29 17:26 GMT+02:00 Aamu Padi <aamup...@gmail.com>:
>>
>>  Hello,
>>> I would like to build a real time web application, but have little idea
>>> of where to start to from. It will have notification and feed system like
>>> facebook or instagram. Would really appreciate if anyone who have already
>>> done this type of web application could kindly guide me through. I will be
>>> very grateful.
>>>
>>
>> I never done such things besides small experiments and research...
>>
>> Here are some pointers:
>>
>> - search://django+gevent
>> - search://django+asyncio among other things django-c10k-demo
>> <https://github.com/aaugustin/django-c10k-demo> created by Aymeric
>> Augustin django core contributor which use websockets
>> - search://tornado
>> - search://django+SSE
>> - search://django+webRTC
>> - search://django+pjax
>>
>> HTH,
>>
>> Amirouche
>>
>>>
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAHSNPWuiOJ5m%3DcCUFOc-j%3DRR3LHSAOyhd4Uk7HOaR78cQB-V4A%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAHSNPWuiOJ5m%3DcCUFOc-j%3DRR3LHSAOyhd4Uk7HOaR78cQB-V4A%40mail.gmail.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/CAL7_Mo9Tfqi_BsM2KCLX7aVNZFZcC0vMO6eu1tMtrY-H6L8GKg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAL7_Mo9Tfqi_BsM2KCLX7aVNZFZcC0vMO6eu1tMtrY-H6L8GKg%40mail.gmail.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/CA%2B4-nGpvDaKasrw_f-Bj6-B7UW6WRtDd17b%2BMk9BJ-WbKtwDJg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2B4-nGpvDaKasrw_f-Bj6-B7UW6WRtDd17b%2BMk9BJ-WbKtwDJg%40mail.gmail.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/CAL7_Mo8pE3hjuYraGxMTW33%3DLHjKH0b_8oYzuo7MpQ%2BOcz4jYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Guidance needed - Real time and django

2014-08-31 Thread Amirouche Boubekki
Hello,


2014-08-29 17:26 GMT+02:00 Aamu Padi <aamup...@gmail.com>:

> Hello,
> I would like to build a real time web application, but have little idea of
> where to start to from. It will have notification and feed system like
> facebook or instagram. Would really appreciate if anyone who have already
> done this type of web application could kindly guide me through. I will be
> very grateful.
>

I never done such things besides small experiments and research...

Here are some pointers:

- search://django+gevent
- search://django+asyncio among other things django-c10k-demo
<https://github.com/aaugustin/django-c10k-demo> created by Aymeric Augustin
django core contributor which use websockets
- search://tornado
- search://django+SSE
- search://django+webRTC
- search://django+pjax

HTH,

Amirouche

>
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHSNPWuiOJ5m%3DcCUFOc-j%3DRR3LHSAOyhd4Uk7HOaR78cQB-V4A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHSNPWuiOJ5m%3DcCUFOc-j%3DRR3LHSAOyhd4Uk7HOaR78cQB-V4A%40mail.gmail.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/CAL7_Mo9Tfqi_BsM2KCLX7aVNZFZcC0vMO6eu1tMtrY-H6L8GKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: cms web buyilding

2014-08-19 Thread Amirouche Boubekki
2014-08-18 10:00 GMT+02:00 ngangsia akumbo <ngang...@gmail.com>:

> then if drupal , jomlam has what django has then why are u building app
> with django, that requires much coding?
>

That's the point, django admin and a good "plugin" flora (called «django
applications» in Django noosphère) you don't need to code much to build
very different kind of apps. Whereas if you start with a CMS (even a Django
CMS) you will have to follow the path of the CMS
which might be good to learn or to prototype an application but isn't
always the best solution as a software developer.

I think there is a difference between the old days «webmaster» and today
«developer». Not all «webmaster» became «developer». The people you are
describing «tweaking a CMS» looks more like a «webmaster» than a
«developer».

A developer must be able to write any kind of app, not only Content
Management Systems, but also applications like twitter, facebook, GNU
MediaGoblin, a plugin system inside it's own project etc... but also take
one week to read all the documentation *and code* of a given framework.

I'm pretty sure that if you do a comparison of django CMS and PHP CMS in
the wild, you would find that they are much more PHP CMS than Django CMS
normalized to the number of developpers. This is not because Django or
Python is not popular (since it is normalized to the number of
developpers), but because Python people prefer to build their own
application and take advantage of other Django applications instead of
«hijacking» a CMS.

I'm not saying that webmaster don't help the craft, I say that they have
different skills and do different jobs.


>
>
> On Saturday, August 16, 2014 10:01:02 PM UTC+1, Amirouche Boubekki wrote:
>
>> Reading my answer on a desktop computer, doesn't inspire me much. So I
>> rewrite here... Sorry for the triple post...
>>
>>
>> 2014-08-16 18:59 GMT+02:00 <amirouche...@gmail.com>:
>>
>>
>>>
>>> À Sat Aug 16 2014 12:04:20 GMT+0200 (CEST), ngangsia akumbo a écrit :
>>> > I was having an argument about learning how to code from scratch and
>>> using
>>> > content management systems like joomla, dupal to build websites.
>>>
>>
>> I sum up this as:
>>
>> > Learn a language by building something on top a CMS like joomla, drupal
>> or django cms, amstrong...
>>
>> - This is one way maybe one of the best way. It's among the few
>> recommendation I remember from university [1], it was basically was «get
>> pixels in the browser quickly». Doing TDD would be best. This is the idea
>> behind dynamic languages and their REPL.
>>
>> [1] another one is «WTF is NP & P. What matters are numbers!»
>>
>> - It is basically a copy/pasting code from cookbook and making them do
>> the right thing cf. https://djangosnippets.org/ that's how I build my
>> first enduser application (somekind of a social network) ten years ago in
>> with PHP and mysql, way before any kind of computer science curriculum or
>> webmaster course.
>>
>> - The good thing is that you have clear entry point to modify the
>> behavior of the vanilla application. Those entry points are higher level:
>> «add an item to the menu», «add item into the overview div»...  When you
>> start from scratch with only a framework you might stare blankly into an
>> elite IDE without much inspiration, because you can start from many places:
>> views, models, templates and how they interact make the number of possible
>> application manyfolds. Most of the time I start with models, then create
>> html mockup pages then glue them together with views.
>>
>> - You can get lost about what kind of application you can do, since you
>> can do much more with a framework with the same coding level.
>>
>> Only downside is that with a framework you start with a lot of code to
>> read «ark! there is an infinite recursion somewhere!», but this will help
>> later. I understand more quickly code than dozens of examples use of some
>> class.
>>
>> A ready made CMS, can also be used to do «gunshot coding» which basicly
>> boils down to turn working code to crap code and getting back a new code
>> that does something you want to do. Can also be understood as «copy & paste
>> then fix it»
>>
>>
>>> >
>>> > This guy was telling they can make any web application using Joomla
>>> the the
>>> > other cms out there.
>>> > He does not need to learn coding.
>>>
>>
>> Yes. Most of my early application that me and my friend were using were
>> just hacks of SPIP (ready made CMS for hacks) or wordpress, phpbb,
>> dotclear...
>

Re: Should I use generic foreign key, and how?

2014-08-17 Thread Amirouche Boubekki
2014-08-17 11:24 GMT+02:00 Vladimir Chukharev 
:

>
>
> On Saturday, August 16, 2014 10:46:33 PM UTC+3, Aaron Law wrote:
>>
>>
>> Hi all,
>>
>> I have php web programming background, and new to Django. I am helping my
>> brother to build an online system to manage inventory, and I've got a
>> database design & coding problem recently. Needing help!
>>
>> That is, I have a set of tables of "possible products", "inventory",
>> "suppiler", etc. I want to attach a "comment" to each of them. Therefore, I
>> think I should make a generic "comment" table to hold all the comments of
>> products, inventory, suppiler.
>>
>> --
>> possible_products
>> id: int (pk)
>> name: varchar
>> url: varchar
>> price: decimal
>> created_at: datetime
>> updated_at: datetime
>> --
>> comments
>> id: int (pk)
>> parent_id: int (fk)
>> content: text
>> author: int (fk)
>> table: char (which the table this comment belongs to)
>> created_at: datetime
>> updated_at: datatime
>> --
>>
>> My problem is, when "possible_products" table is the parent of "comment",
>> then a foreign key of the parent (id number) is stored in the "comment"
>> table in order to link up them.
>>
>
>> However, how about the fk of the "inventory" table and the "suppiler"
>> table? It should not be that: I create 2 more columns of "inventory_id" nor
>> "suppiler_id" in "comments" table. (That is, I should not create the 4th
>> column when I want to link up the 4th parent table.)
>>
>
> You can make the fk to the "possible_products" table. In your particular
> case, I do not see reasons to take comments into a separate table rather
> than in the parent table, though this might be just omitted in the
> description.
>

I second that. I don't understand why you need to make another table to
store comments.


> I do use this style of inheriting tables with connections between them. If
> you are interested, I have one project in this style in googlecode (early
> stage yet): labman2 .
>
> Note that django docs generally discourage using the involved type on
> table inheritance. I attribute this discourage to wide use of mysql...
>
>
>> So, Should I use generic forgien key of Django? (so that, my "comment"
>> table design is right.) And how to use/implement it?
>>
>> P.S I mainly develop the system in the Admin section of Django.
>>
>> Regards,
>> Aaron Law Ho hon
>> --~--~-~--~~~---~--~~
>> Free as in Freedom ;-)
>> --~--~-~--~~~---~--~~
>>
>  --
> 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/93d80efa-8ef3-426f-a492-f19222c6a4cc%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/CAL7_Mo8bRX0vAX5hzF_-ajcU4MmPtufJKZ3MQU%3D0dLGNc-Yf9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should I use generic foreign key, and how?

2014-08-17 Thread Amirouche Boubekki
2014-08-16 21:45 GMT+02:00 Aaron Law :

>
> Hi all,
>
> I have php web programming background, and new to Django. I am helping my
> brother to build an online system to manage inventory, and I've got a
> database design & coding problem recently. Needing help!
>
> That is, I have a set of tables of "possible products", "inventory",
> "suppiler", etc. I want to attach a "comment" to each of them. Therefore, I
> think I should make a generic "comment" table to hold all the comments of
> products, inventory, suppiler.
>
> --
> possible_products
> id: int (pk)
> name: varchar
> url: varchar
> price: decimal
> created_at: datetime
> updated_at: datetime
> --
> comments
> id: int (pk)
> parent_id: int (fk)
> content: text
> author: int (fk)
> table: char (which the table this comment belongs to)
> created_at: datetime
> updated_at: datatime
> --
>
> My problem is, when "possible_products" table is the parent of "comment",
> then a foreign key of the parent (id number) is stored in the "comment"
> table in order to link up them.
>
> However, how about the fk of the "inventory" table and the "suppiler"
> table? It should not be that: I create 2 more columns of "inventory_id" nor
> "suppiler_id" in "comments" table. (That is, I should not create the 4th
> column when I want to link up the 4th parent table.)
>
> So, Should I use generic forgien key of Django? (so that, my "comment"
> table design is right.) And how to use/implement it?
>

You SHOULD rather create an abstract ProductBase model class with a
ManyToMany Field pointing to Comment class and then inherit ProductBase for
each specific products.

Most of the time class names are singular.


> P.S I mainly develop the system in the Admin section of Django.
>

See also: django polymorphic.

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


Re: cms web buyilding

2014-08-16 Thread Amirouche Boubekki
Reading my answer on a desktop computer, doesn't inspire me much. So I
rewrite here... Sorry for the triple post...


2014-08-16 18:59 GMT+02:00 :

>
>
> À Sat Aug 16 2014 12:04:20 GMT+0200 (CEST), ngangsia akumbo a écrit :
> > I was having an argument about learning how to code from scratch and
> using
> > content management systems like joomla, dupal to build websites.
>

I sum up this as:

> Learn a language by building something on top a CMS like joomla, drupal
or django cms, amstrong...

- This is one way maybe one of the best way. It's among the few
recommendation I remember from university [1], it was basically was «get
pixels in the browser quickly». Doing TDD would be best. This is the idea
behind dynamic languages and their REPL.

[1] another one is «WTF is NP & P. What matters are numbers!»

- It is basically a copy/pasting code from cookbook and making them do the
right thing cf. https://djangosnippets.org/ that's how I build my first
enduser application (somekind of a social network) ten years ago in with
PHP and mysql, way before any kind of computer science curriculum or
webmaster course.

- The good thing is that you have clear entry point to modify the behavior
of the vanilla application. Those entry points are higher level: «add an
item to the menu», «add item into the overview div»...  When you start from
scratch with only a framework you might stare blankly into an elite IDE
without much inspiration, because you can start from many places: views,
models, templates and how they interact make the number of possible
application manyfolds. Most of the time I start with models, then create
html mockup pages then glue them together with views.

- You can get lost about what kind of application you can do, since you can
do much more with a framework with the same coding level.

Only downside is that with a framework you start with a lot of code to read
«ark! there is an infinite recursion somewhere!», but this will help later.
I understand more quickly code than dozens of examples use of some class.

A ready made CMS, can also be used to do «gunshot coding» which basicly
boils down to turn working code to crap code and getting back a new code
that does something you want to do. Can also be understood as «copy & paste
then fix it»


> >
> > This guy was telling they can make any web application using Joomla the
> the
> > other cms out there.
> > He does not need to learn coding.
>

Yes. Most of my early application that me and my friend were using were
just hacks of SPIP (ready made CMS for hacks) or wordpress, phpbb,
dotclear...


> > so if that was possible why do people still learn how to code from
> scratch?
>

Performance and *sustainability. *Depending on what you do, you might not
need to learn to code. How many stories I ear by friends and family of the
kevin next door getting dozen bucks a month for installing and configuring
one of the other of the

*ready made solutions. *
Usually, python people are not interested by performance, but are glad to
have a perfect backend that can serve multiple devices with the same code.
Does phpbb allow to retrieve the list of incoming message in JSON
compatible with a ready made twitter client...

Or a perfect *{{ name-the-application-of-the-kevin-next-door }}* user
experience which needs specific models, views and templates?

Or a CMS with hand crafted backends (and frontends
 ;) for every job in the
entreprise without taking too much time to answer
?


> >
> > So i need to get your opinion about this?
> >
>

I don't know the state of the art in PHP, maybe they are framework that
have what Django (and other python framework) have:

- python language
- cookbook and books
- several cms on top of it
- plugin system with numerous plugins freely available

With the above you get almost all of what Drupal has, plus what I never
found in the documentation, its «internals» aka. the framework part of
drupal, which at the end of the day, is for people that want to get serious
things done, is more interesting for the craft than yet another forum
.



>
>  HTH
>
>
> > --
>
> > 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/5383030b-f2bb-4a8a-b3ed-5064e462d966%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> Envoyé depuis mon Jolla

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To 

Re: cms web buyilding

2014-08-16 Thread amirouche . boubekki


À Sat Aug 16 2014 12:04:20 GMT+0200 (CEST), ngangsia akumbo a écrit :
> I was having an augment about learning how to code from scratch and using 
> content management systems like joomla, dupal to build websites.
> 
> This guy was telling they can make any web application using Joomla the the 
> other cms out there.
> He does not need to learn coding.
> so if that was possible why do people still learn how to code from scratch?
> 
> So i need to get your opinion about this?
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/5383030b-f2bb-4a8a-b3ed-5064e462d966%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Envoyé depuis mon Jolla

-- 
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/btggn6.naez1z.1hge13l-qmf%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: cms web buyilding

2014-08-16 Thread amirouche . boubekki


À Sat Aug 16 2014 12:04:20 GMT+0200 (CEST), ngangsia akumbo a écrit :
> I was having an augment about learning how to code from scratch and using 
> content management systems like joomla, dupal to build websites.
> 
> This guy was telling they can make any web application using Joomla the the 
> other cms out there.
> He does not need to learn coding.
> so if that was possible why do people still learn how to code from scratch?
> 
> So i need to get your opinion about this?
> 

Easy answer is performance lookup "wordpress (farms OR performance)"

Another answer is that if you know the langage it s easier to fully learn a 
framework than learn a cms. A cms must have something like a framework put 
together inside the website engine. More sloc means more things to read and 
understand.

So learning a fw  is easier and you get more power out of it, even if you have 
no ready to eye shoot nice pixels put together in a browser.

You get a similar coding experience as using a cms using Django admin to build 
a web engine, I'm still not convinced that current dj admin is the best tool 
for high quality craft.

Also most python fw and especially djanjo have a lot of plugins/extension which 
evenif they don t always attract the hurry client satisfy the smart coder.
 
 HTH

 
> --
 
> 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/5383030b-f2bb-4a8a-b3ed-5064e462d966%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Envoyé depuis mon Jolla

-- 
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/rx8qin.naesjb.2y85jf-qmf%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: Model Objects and Updating db via XML

2014-05-23 Thread Amirouche Boubekki
Héllo (again),


2014-05-14 22:41 GMT+02:00 Sayth Renshaw <flebber.c...@gmail.com>:

> Thanks Tom, I have set up a way to extract the elements I want with
> xmltodict and played with lxml.objectify last night and that would work as
> well.
>
> But what exactly in django models am I using to bring in the data?
>

Django knows how to load data from json, xml, whatnot only if it knows
about the format. I don't remember
we considered Django native serialization/unserialization support (see my
mail on Python ML).

The thing is that, in your project, it seems like import is a "one time
thing". So maybe using a framework thingy like django-swallow or a custom
django's fixture thing is too much.

Anyway, here is the "getting started" document of django
swallow<https://github.com/liberation/django-swallow/blob/master/doc/source/walkthrough.rst>,
summed up below:

- Builder class: entry point for an import, this used among other thing to
trigger the import from command line.
- Mapper class: create "mapping object" for the input xml. Basically it
breaks down a xml into sub-documents (if it's rss/atom like xml) or a
single object if it's actually only one document, pythonize the xml data
and make it easily accessible as object properties... no heavy processing
of data or mapping to data already in the database. For instance, if you
have an identifier, that maps to a row in the database, you retrieve the
populator (see below) will retrieve the identifier as an integer or string
and convert it to a Django model...
- Populator class: it helps populating the target django model object. It
implements common operations, like «model.foo = mapper.foo» and other stuff.

The idea behind django swallow, is that an import is breaked down into
several steps:

- parse xml, and turn in into simple python object(s) with python types
(Mapper class)
- populate one django model instance (or several) with based on the data
from the first step (Populator class)

They are extra optional steps ;)

I'm not sure about what is the repository, but for instance you can create
a base mapper, which will populate a plain python objects from xpath and
then the populator can be as simple as:

class Populator(BasePopulator):


_fields_one_to_one = None  # XXX: in this case None means map
every properties of the mapper object to the model fields with the
same name...
_fields_if_instance_already_exists = None
_fields_if_instance_modified_from_last_import = None



It's may seem kind of overkill. But when you have 5+ imports running
everyday, business critical, processing several dozen of files, for
different kind of documents it's helpful to know that the implementation is
built in a canvas, a framework, you know where to look for the code
implementing a behaviour depending on the behaviour... whether it is for
debugging or building new imports...

There is a full but simple example, importing items from an atom file:
https://github.com/liberation/django-swallow/blob/master/example/config.py

HTH,


Amirouche


> Sayth
> On 15/05/2014 1:13 am, "Tom Evans" <tevans...@googlemail.com> wrote:
>
>> On Tue, May 13, 2014 at 8:40 PM, Sayth Renshaw <flebber.c...@gmail.com>
>> wrote:
>> > Can I ask for some assistance please.
>> >
>> > For my project I will need to upate the database from an external xml
>> file
>> > consistently. The xml is like this one
>> > http://old.racingnsw.com.au/Site/_content/racebooks/20140515GOSF0.xml
>> > If i have create my model objects, most of which will have a direct
>> > correlation to the xml file, but there will be extra model objects and
>> > fields relating to user input. How can I do updates to my database via
>> xml.
>> >
>> > There are 2 docs I have been reviewing
>> >
>> https://docs.djangoproject.com/en/1.6/howto/initial-data/#providing-initial-data-with-fixtures
>> > and https://docs.djangoproject.com/en/1.6/topics/serialization/.
>> >
>> > The guides talk about creating a fixture but I am not sure it is
>> appropriate
>> > exactly and I am unsure from the guide how I would setup a mapping so
>> that
>> > the xml data went to the correct model object.
>> > How do I do this?
>> >
>>
>> I don't think you want fixtures, even though there are XML fixtures.
>> This is basically a data feed which periodically you wish to import in
>> to your own database. Fixtures are normally exports of your own
>> database. I think it would be very difficult to ensure that your
>> database always matches the contents of an XML file produced by a 3rd
>> party.
>>
>> You could use xslt to transform the 3rd party xml in to the right
>> format for an xml serialisati

Re: Interesting Django project folder structure.

2014-04-23 Thread Amirouche Boubekki
2014-04-21 16:00 GMT+02:00 Tianyi Wang :

> Today I was reading through
> http://www.deploydjango.com/django_project_structure (great resource)
>
> The suggested folder structure for a Django project from this site is like
> below:
> (I'm only interested in layout for Django apps, not requirements files or
> settings files)
>
>
> myproject
> |-- manage.py
>
> |-- requriements.txt
> |-- *myproject*
> |-- __init__.py
>
> |-- settings.py
> |-- urls.py
> |-- wsgi.py
>
> |
> `-- *apps*
>
> |-- __init__.py
>
> |-- *app_one*
>
> |   |-- __init__.py
> |   |-- models.py
> |   |-- views.py
> |   `-- urls.py
> `-- *app_two*
> |-- __init__.py
> |-- models.py
> |-- views.py
> `-- urls.py
>
>
I don't see the point of this structure really. Maybe, it's kind of helpful
to figure quickly where are the "app" directories, which can not be
immediate matter if you have other directories in myproject/ like
template_tags/ or urls/, why would you do that anyway?

I prefer your setup:


> My current setup is like below:
>
> myproject
> |-- manage.py
>
> |-- requirements.txt
> |-- *myproject*
> |   |-- __init__.py
> |   |-- settings.py
> |   |-- urls.py
> |   `-- wsgi.py
> `-- *app_one*
> |   |-- __init__.py
> |   |-- models.py
> |   |-- views.py
> |   `-- urls.py
> `-- *app_two*
> |-- __init__.py
> |-- models.py
> |-- views.py
> `-- urls.py
>
>
> The reason for the first layout is to categorise the apps,
>
> so one can have a "apps" folder contains all the custom apps;
>
>
> "libs" folder contains all the lib/helper apps and such.
>
>
Or something more sophisticated like:

myproject/
 myproject/ # created by startproject command, holds settings and stuff
 generic/  # holds generic apps
 integration/  # holds integration only apps of generic apps (apps that
only link to generic apps)
 custom/  # holds specific apps they can make use of any other kind of apps
 helpers/  # non app libraries

requirements.txt is usually not in a python package but in the root source
directory.

Do you guys think it's a good idea?
>
> Yes, as soon as you don't loose too much time fiddling with such matter,
it's helpful :)


>
> Cheers
>
>
> Tianyi
>
>  --
> 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/37ecd6cb-6dcc-431e-ae39-3814dbf647de%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/CAL7_Mo9f6%3D6Z1%2BPYoO3_4D_unQtvHz_oadpggZm_1dW1%2BE%3DbDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Prototype of an Online Voting System (I need some constructive criticism here)

2013-12-13 Thread Amirouche Boubekki
- «vq_chc.final_count += final_count» works well.
>
You need to use Django update or the operation is not atomic.

-- 
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/CAL7_Mo-qYLrnDGd9%3DXNfQGN9g1hJze5%3D_H7-KyobHm3av7vn-g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Prototype of an Online Voting System (I need some constructive criticism here)

2013-12-13 Thread Amirouche Boubekki
Héllo Amimo,


2013/12/13 Amimo Benja <amimobenj...@gmail.com>

> simple_prototype_of_online_voting_system
> ==
>

The name must be shorter. «voting_system» is good for instance


> I am new to Django/Python. After a few tutorial, I have tried to develop
> this app.
>


>
> However, I need some constructive criticism as the app needs to be made
> better and improved.
>
> Please view it and highlight the problem/issues cause I know it has a lot
> of issues and then recommend
> the necessary changes and how to implement those changes.
>
> Access the app at http://amimobenja.pythonanywhere.com/voting_system/
>

It seems like I can vote several time. I'not sure because I see nowhere the
number of vote casted.

The code can be accessed at
> https://github.com/amimobenja/simple_prototype_of_online_voting_system
>

- The repository is missing the link to the website (first link)
- Which version of Python/Django do you use?

Code review:

The overal is not bad, need improvement but the app is small so there is
little to comment actually so what follows is mostly *remarks* not big
mistakes

- use 
render<https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#render>instead
of render_to_response
- 
here<https://github.com/amimobenja/simple_prototype_of_online_voting_system/blob/master/online_voting_system/voting_system/views.py#L22>,
you are already doing rendering in the view, it's not good, you should use
a filter in a template, also
- in the same function, you defined two times context_dict
- 
here<https://github.com/amimobenja/simple_prototype_of_online_voting_system/blob/master/online_voting_system/voting_system/views.py#L37>,
try/except is too big, you must only wrap the statment that raise the
exception except if you know what you do...
- Also, you seem to simply return if there is an error. This is a mistake.
- 
here<https://github.com/amimobenja/simple_prototype_of_online_voting_system/blob/master/online_voting_system/voting_system/views.py#L60>,
there is not type checking on the identifier and existence checking, you
must return 404 or 5xx depending on the error.
- «vq_chc.final_count += final_count» works well.
- about function is useless, just use a generic template view for that no
need to have a view.
- Also enforce pep8, 4spaces instead of 8, no short names like «abt»
instead of «about». It's useless cognitive load for the reader.

HTH

Thanks.
>
> I will gladly appreciate
>

Amirouche

-- 
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/CAL7_Mo-8pvPZ2_XWa4DwraGnZxBQJzVf4mqRqkCy_v%3DMfrNQXg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django/Web Programming Pattern

2013-11-14 Thread Amirouche Boubekki
Celery might overkill they are other more simple solutions that only
involve your current database and cron jobs.

Regards,


Amirouche


2013/11/14 Jonathan Baker <jonathandavidba...@gmail.com>

> You're welcome. I just set celery+rabbitmq up on a new project, and while
> it can seem like a lot of steps (and potential information overload), it
> isn't so bad once you get a grasp on the concepts.
>
> One thing that recently bit me: once in production with running workers,
> if the models your task code are interacting with change (in my case, a
> south migration from concrete inheritance to abstract), you need to restart
> the workers just like you would Apache (doc:
> http://docs.celeryproject.org/en/latest/userguide/workers.html#restarting-the-worker).
> This seems obvious to me know, but hindsight...
>
>
> On Thu, Nov 14, 2013 at 8:04 AM, Timothy W. Cook <t...@mlhim.org> wrote:
>
>> Thanks Jonathan.  Looks interesting from the FAQ.
>> I'll give it a shot and see what happens.
>>
>> On Thu, Nov 14, 2013 at 12:39 PM, Jonathan Baker
>> <jonathandavidba...@gmail.com> wrote:
>> > This sounds like a good candidate for an async Celery task:
>> > http://docs.celeryproject.org/en/latest/index.html
>> >
>> >
>> > On Thu, Nov 14, 2013 at 7:37 AM, Timothy W. Cook <t...@mlhim.org> wrote:
>> >>
>> >> Well, this isn't likely a Django specific question but since this
>> >> project is built in Django, I'd like to know how best to handle this
>> >> issue.
>> >>
>> >> I have a view that calls a function and performs a long running
>> >> process.  It reads and processes a file, creating potentially
>> >> thousands of objects and can take up to several minutes to complete.
>> >>
>> >> Right now it just displays a pretty much blank template.  This isn't
>> >> very user friendly.  I imagine some kind of counter or progress bar
>> >> but I am not certain how best to display this via Django.
>> >>
>> >> What do others do in this case?
>> >>
>> >> Thanks,
>> >> Tim
>> >>
>> >>
>> >>
>> >> --
>> >> MLHIM VIP Signup: http://goo.gl/22B0U
>> >> 
>> >> Timothy Cook, MSc   +55 21 94711995
>> >> MLHIM http://www.mlhim.org
>> >> Like Us on FB: https://www.facebook.com/mlhim2
>> >> Circle us on G+: http://goo.gl/44EV5
>> >> Google Scholar: http://goo.gl/MMZ1o
>> >> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>> >>
>> >> --
>> >> 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%2B%3DOU3WXxamXh3avPc%2BmW0yWHJERPACsvvLErx9T8OJc%3D5tsUA%40mail.gmail.com
>> .
>> >> For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>> >
>> >
>> > --
>> > Jonathan D. Baker
>> > Developer
>> > http://jonathandbaker.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.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/CAPMFOb4M7BSndCdN3N0STgwiN%2BA%2BbAZ5f80OkqBtLB1xosfr7A%40mail.gmail.com
>> .
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> --
>> MLHIM VIP Signup: http://goo.gl/22B0U
>> 
>> Timothy Cook, MSc   +55 21 94711995
>> MLHIM http://www.mlhim.org
>> Like Us on FB: https://www.facebook.com/mlhim2
>> Circle us on G+: http://

Re: Invitations Apps

2013-11-08 Thread Amirouche Boubekki
Tell us when you are done, maybe share it on github ?


2013/11/8 Rafael E. Ferrero <rafael.ferr...@gmail.com>

> Avraham Serour Sending the email its not my problem.
> I start to think doing by my self an invitation app for what i need... so
> thank you all you guys!!
>
> See ya.
>
>
>
> 2013/11/8 Amirouche Boubekki <amirouche.boube...@gmail.com>
>
>>
>>
>>
>> 2013/11/8 Avraham Serour <tovm...@gmail.com>
>>
>>> You could create a invitation model, I don't see the problem
>>> but maybe you don't even need to, if all you want is for a user to ask
>>> the server to send some emails you can just do that: let the user ask the
>>> server to send emails.
>>>
>>
>> Invitation are probably limited.
>>
>>
>>
>>>
>>> On Thu, Nov 7, 2013 at 11:43 PM, Rafael E. Ferrero <
>>> rafael.ferr...@gmail.com> wrote:
>>>
>>>> Im doing a project where visitors can registers with his social
>>>> accounts (this it can be done with AllAuth in a very simple way)
>>>> When a visitor get registered the system he can create a group. (this
>>>> is not a problem too)
>>>> But... a registered visitor can invitate, by email, to other people to
>>>> join in his group. The idea is that these guest can login with his own
>>>> social accounts too, So here's the problem, AllAuth make it easy to login
>>>> with social accounts but does not manage invitations.
>>>>  I do not want to reinvent the wheel but if nobody did this before I'm
>>>> afraid that i have to put my hands in the dough.
>>>>
>>>> Cheers !
>>>>
>>>>
>>>> 2013/11/7 Amirouche Boubekki <amirouche.boube...@gmail.com>
>>>>
>>>>> Héllo Rafael,
>>>>>
>>>>>
>>>>> I don't know those particular applications, so I can't help. Do you
>>>>> have a specific problem?
>>>>>
>>>>>
>>>>> 2013/11/7 Rafael E. Ferrero <rafael.ferr...@gmail.com>
>>>>>
>>>>>> No body can help me?
>>>>>>
>>>>>>
>>>>>> 2013/11/7 Rafael E. Ferrero <rafael.ferr...@gmail.com>
>>>>>>
>>>>>>
>>>>>>> Has someone used some invitation app for django like
>>>>>>> django-invitation [1]... and more, has someone integrated something like
>>>>>>> that with AllAuth [2] ??
>>>>>>>
>>>>>>> In a project I need visitors to register on the site with their social
>>>>>>> accounts. Once registered the system will create a group which will
>>>>>>> own. Then the owner of the group may invite people to integrate this
>>>>>>> group. Those who respond to the invitation may log in with their social
>>>>>>> accounts too. Guests can not create groups, because they are guests.
>>>>>>>
>>>>>>> Someon has some tips for me?
>>>>>>>
>>>>>>> Thanks a lot!
>>>>>>>
>>>>>>>
>>>>>>> [1] https://bitbucket.org/david/django-invitation/wiki/Home
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>  [2] https://github.com/pennersr/django-allauth
>>>>>>>
>>>>>>
>>>>> I don't know this application, I know about:
>>>>>
>>>>> - python-social-auth
>>>>> - http://peterhudec.github.io/authomatic/ something like that
>>>>>
>>>>> Both are nice and probably work but I couldn't use because I did not
>>>>> use django for this specific project and they did not integrate well.
>>>>>
>>>>>
>>>>> Hope this helps,
>>>>>
>>>>>
>>>>>
>>>>> Amirouche
>>>>> --
>>>>> 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-u

Re: Invitations Apps

2013-11-08 Thread Amirouche Boubekki
2013/11/8 Avraham Serour <tovm...@gmail.com>

> You could create a invitation model, I don't see the problem
> but maybe you don't even need to, if all you want is for a user to ask the
> server to send some emails you can just do that: let the user ask the
> server to send emails.
>

Invitation are probably limited.



>
> On Thu, Nov 7, 2013 at 11:43 PM, Rafael E. Ferrero <
> rafael.ferr...@gmail.com> wrote:
>
>> Im doing a project where visitors can registers with his social accounts
>> (this it can be done with AllAuth in a very simple way)
>> When a visitor get registered the system he can create a group. (this is
>> not a problem too)
>> But... a registered visitor can invitate, by email, to other people to
>> join in his group. The idea is that these guest can login with his own
>> social accounts too, So here's the problem, AllAuth make it easy to login
>> with social accounts but does not manage invitations.
>>  I do not want to reinvent the wheel but if nobody did this before I'm
>> afraid that i have to put my hands in the dough.
>>
>> Cheers !
>>
>>
>> 2013/11/7 Amirouche Boubekki <amirouche.boube...@gmail.com>
>>
>>> Héllo Rafael,
>>>
>>>
>>> I don't know those particular applications, so I can't help. Do you have
>>> a specific problem?
>>>
>>>
>>> 2013/11/7 Rafael E. Ferrero <rafael.ferr...@gmail.com>
>>>
>>>> No body can help me?
>>>>
>>>>
>>>> 2013/11/7 Rafael E. Ferrero <rafael.ferr...@gmail.com>
>>>>
>>>>
>>>>> Has someone used some invitation app for django like django-invitation
>>>>> [1]... and more, has someone integrated something like that with AllAuth
>>>>> [2] ??
>>>>>
>>>>> In a project I need visitors to register on the site with their social
>>>>> accounts. Once registered the system will create a group which will
>>>>> own. Then the owner of the group may invite people to integrate this
>>>>> group. Those who respond to the invitation may log in with their social
>>>>> accounts too. Guests can not create groups, because they are guests.
>>>>>
>>>>> Someon has some tips for me?
>>>>>
>>>>> Thanks a lot!
>>>>>
>>>>>
>>>>> [1] https://bitbucket.org/david/django-invitation/wiki/Home
>>>>>
>>>>
>>>
>>>
>>>
>>>>  [2] https://github.com/pennersr/django-allauth
>>>>>
>>>>
>>> I don't know this application, I know about:
>>>
>>> - python-social-auth
>>> - http://peterhudec.github.io/authomatic/ something like that
>>>
>>> Both are nice and probably work but I couldn't use because I did not use
>>> django for this specific project and they did not integrate well.
>>>
>>>
>>> Hope this helps,
>>>
>>>
>>>
>>> Amirouche
>>> --
>>> 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/CAL7_Mo9nHfUbR-OrvOjLALUZmeqqSKePbhzYuZXzOcxUaFC%3DJg%40mail.gmail.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> Rafael E. Ferrero
>>  --
>> 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/CAJJc_8XfAHskv35fZw%3D-GMT16%2Bvp%3DcU0W9BCokOm_Y158N0pHA%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django us

Re: Invitations Apps

2013-11-07 Thread Amirouche Boubekki
Héllo Rafael,


I don't know those particular applications, so I can't help. Do you have a
specific problem?


2013/11/7 Rafael E. Ferrero <rafael.ferr...@gmail.com>

> No body can help me?
>
>
> 2013/11/7 Rafael E. Ferrero <rafael.ferr...@gmail.com>
>
>
>> Has someone used some invitation app for django like django-invitation
>> [1]... and more, has someone integrated something like that with AllAuth
>> [2] ??
>>
>> In a project I need visitors to register on the site with their social
>> accounts. Once registered the system will create a group which will own. Then
>> the owner of the group may invite people to integrate this group. Those
>> who respond to the invitation may log in with their social accounts too.
>> Guests can not create groups, because they are guests.
>>
>> Someon has some tips for me?
>>
>> Thanks a lot!
>>
>>
>> [1] https://bitbucket.org/david/django-invitation/wiki/Home
>>
>



>  [2] https://github.com/pennersr/django-allauth
>>
>
I don't know this application, I know about:

- python-social-auth
- http://peterhudec.github.io/authomatic/ something like that

Both are nice and probably work but I couldn't use because I did not use
django for this specific project and they did not integrate well.


Hope this helps,



Amirouche

-- 
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/CAL7_Mo9nHfUbR-OrvOjLALUZmeqqSKePbhzYuZXzOcxUaFC%3DJg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] Django-Tests-Assistant

2013-10-13 Thread Amirouche Boubekki
Héllo everyone and else,


I'm pleased to announce the immediate availability of Tests
Assistant<https://github.com/tests-assistant/tests-assistant/>an
application that helps the developer to test manually an application.
In
it's current form it's a Django application that you can install in any
django project. It has the following features:

- Create, Tag, Search and delete tests
- Create, Tag and Play runs which are a groups of tests, those runs are
timed and reported in the related tests

It can be used in a professional context to replace software like HP
Quality Center or TestLink. It's of great use, it's fun, has a great logo
and both free as in “free speech” and free as in “free drink”!

After one month on github and pypi, we have a positive feedback in terms of
downloads, 1.7K download on pypi, so we guess that it's of good use, which
we already knew since we use it at work.

As usual, any help will be greatly appreciated and any feedback, bug
reports, ideas and postal cards are accepted! That said, we'd like to keep
the spirit of this application as is, which means that if you propose a
feature it might go in a fork of this app, such features include:

- User and permissions handling
- Truly multi-project (can be handled with tags)
- Reports (per user, per project, per platforms/targets etc...)

Which means that you can always report a use case that is not handled by
the application but that this particular feature might be out of the scope
of this one, still it will be helpful so don't hesitate.

Also, the code is small enough and simple enough to be read in 3 hours by a
beginner, and since it's not the usual blog engine application, it can be
more interesting :)

Also the “tag cloud select” widget only works on firefox, so if you know
javascript and jquery you might help by fixing it (wired GC bug I
think). Thanks in advance.

Anyway, have a good use of this app!

Cheers,


Amirouche

[1] https://github.com/tests-assistant/tests-assistant/
[2] https://pypi.python.org/pypi/django-tests-assistant

-- 
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/CAL7_Mo_4pYktgnsa4Ec1iqB-NCUPhEj1OjUFzptNyrcYZ0BeWw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: PyCons in Africa

2013-10-06 Thread Amirouche Boubekki
Hi,

Great initiative!

On Friday, October 4, 2013 6:13:44 PM UTC+2, Daniele Procida wrote:
>
> First of all, apologies if you have to read this more than once because of 
> the cross-posting. 
>
> I've had an idea brewing recently. 
>
> I went to meet Professor Judith Hall this afternoon to talk about it. 
> She's involved with http://medicine.cardiff.ac.uk/mothers-africa/(amongst 
> other things) and is working on a Cardiff University project which 
> itself is part of 
> http://wales.gov.uk/topics/health/improvement/index/grants/?lang=en 
>
> Following that meeting, I bashed out: 
> https://github.com/evildmp/pycons-in-africa/ - please take a look, and 
> even better, let me know what you think, or make your own contribution to 
> the document. I'll continue working on it myself. 
>
> Thanks, 
>
> Daniele 
>
>

-- 
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/cfcf3490-69de-4a8d-a73d-e2ee3f7fb518%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Search from database

2013-07-23 Thread Amirouche Boubekki
Apache solr or ElasticSearch: yes
Haystack: maybe
Regex: no


2013/7/21 Kamal Kaur 

> We can search from database using phonetic codes or queries. I want an
> advanced search module in my project. That can suggest similar
> spellings from database, if user enters something wrong, like if
> something is misspelled, it must tell that you might have entered
> something wrong, similar results are shown. And more options for user
> to search accordingly. Can something be done using regex? or I need to
> go for Haystack/Apache solr?
>
>
> --
> Kamaljeet Kaur
>
> Blog:http://kamalkaur188.wordpress.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.
> 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: Search from database

2013-07-21 Thread Amirouche Boubekki
You have to build it yourself or use something like solr
http://lucene.apache.org/solr/ I forgot the name other of the buzzing one.
maybe Haystack has support for suggestion.


2013/7/20 Kamal Kaur 

> Can we have a search module in django that can suggest resembling
> spellings from mysql database?
>
> --
> Kamaljeet Kaur
>
> Blog:http://kamalkaur188.wordpress.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.
> 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: Big Picture?

2013-07-14 Thread Amirouche Boubekki
The link to new version is missing:
https://github.com/amirouche/experiments/tree/master/django-big-picture

Thanks again, please share with us what were you misconceptions maybe one
can improve from them or maybe can also make it more clear in the diagram :)


2013/7/14 Subhodip Biswas <subhodipbis...@gmail.com>

> Hi,
>
> That diagram clears a lot of misconceptions that I had. Thanks a lot for
> that. Will keep it as a reference.
>
>
>
>
>
> -
> Regards
> Subhodip Biswas
>
>
> GPG key : FAEA34AB
> Server : pgp.mit.edu
> http://subhodipbiswas.wordpress.com
>
>
>
> On Sun, Jul 14, 2013 at 8:38 PM, Amirouche Boubekki <
> amirouche.boube...@gmail.com> wrote:
>
>>
>>
>>>
>>>> I normally dislike technical "diagrams", but this is simple and awesome
>>>> :-) -- it's a really nice "big picture" and introduction to the different
>>>> components that can be hard to visualize in one's head when just getting
>>>> started .. do you mind if I use it when introducing people to Django? (with
>>>> credit, of course:))
>>>>
>>>
>>> Thanks!
>>>
>>> I've moved it online, with licensing cc by sa [1] so anybody anywhere
>>> can use it, both png and svg version (edited with inkscape) are available.
>>>
>>
>> an updated version with minor correction ;)
>>
>> Of course any contributions is welcomed.
>>
>>
>>>
>>> [1] http://creativecommons.org/licenses/by-sa/3.0/
>>>
>>  --
>> 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.
>
>
>

-- 
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: Big Picture?

2013-07-14 Thread Amirouche Boubekki
>
>> I normally dislike technical "diagrams", but this is simple and awesome
>> :-) -- it's a really nice "big picture" and introduction to the different
>> components that can be hard to visualize in one's head when just getting
>> started .. do you mind if I use it when introducing people to Django? (with
>> credit, of course:))
>>
>
> Thanks!
>
> I've moved it online, with licensing cc by sa [1] so anybody anywhere can
> use it, both png and svg version (edited with inkscape) are available.
>

an updated version with minor correction ;)

Of course any contributions is welcomed.


>
> [1] http://creativecommons.org/licenses/by-sa/3.0/
>

-- 
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: Big Picture?

2013-07-14 Thread Amirouche Boubekki
2013/7/8 Sanjay Bhangar <sanjaybhan...@gmail.com>

>
>
>
> On Sun, Jul 7, 2013 at 7:05 AM, Amirouche Boubekki <
> amirouche.boube...@gmail.com> wrote:
>
>> Hi,
>>
>> I have a diagram I call big picture, you might find it useful (see
>> attachment).
>>
>> Anything green is most of the time provided by the framework at least it
>> is the case in Django.
>>
>> Anything gray you have to make a choice for.
>>
>> Anything blue is your code.
>>
>> Arrows are kind of inspired snakes I'm not sure of the meaning of each of
>> them ;)
>>
>>
>>
> I normally dislike technical "diagrams", but this is simple and awesome
> :-) -- it's a really nice "big picture" and introduction to the different
> components that can be hard to visualize in one's head when just getting
> started .. do you mind if I use it when introducing people to Django? (with
> credit, of course:))
>

Thanks!

I've moved it online, with licensing cc by sa [1] so anybody anywhere can
use it, both png and svg version (edited with inkscape) are available.


[1] http://creativecommons.org/licenses/by-sa/3.0/


> Thanks again!
> -Sanjay
>
> --
> 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: Big Picture?

2013-07-14 Thread Amirouche Boubekki
2013/7/7 Amirouche Boubekki <amirouche.boube...@gmail.com>

> Hi,
>
> I have a diagram I call big picture, you might find it useful (see
> attachment).
>
> Anything green is most of the time provided by the framework at least it
> is the case in Django.
>
> Anything gray you have to make a choice for.
>
> Anything blue is your code.
>
> Arrows are kind of inspired snakes I'm not sure of the meaning of each of
> them ;)
>

There at least one mistake in this diagram, middlwares come after routing
but before view processing

-- 
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: soundx algo in search

2013-07-10 Thread Amirouche Boubekki
Héllo again,

It sound like not something I would do in my application but in a separate
daemon.

Basically what you need is call a fonction that will return a list of
names. The «function» is initialised with a certains number of names that
it can return, is that it ?


2013/7/9 Harjot Mann 

> Below is  the soundex algorithm in python. I want to implement it in
> my search function, please help me how it will work for my search.
> http://tny.cz/8d5ba06f
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.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.
> 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: redirct page

2013-07-06 Thread Amirouche Boubekki
Hi,

Redirection is done in the view after form processing et al. with redirect
shortcut


2013/7/6 Kakar Arunachal Service 

> Hi,
> I am having trouble with redirecting the login page to index page. Please
> guide me.
>
> Here's the html snippet:
> 
> User Login
> {% if form.errors %}
> Your username and password didn't match.
> Please try again.
> {% endif %}
> 
> Username:{{
> form.username }}
> Password:{{
> form.password }}
> 
> 
> 
> 
>
> 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.
> 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: Embedded documents doubts

2013-07-03 Thread Amirouche Boubekki
This is a mongodb database design issue, please forward your question to
mongodb user mailling list.

AFAIK, it only makes sens if the contact is used nowhere else.


2013/7/2 Hélio Miranda 

> Hi
> I have an application in Django-Tastypie and MongoDB, where I have to
> enter a club, that club can have multiple contacts.
> So I was thinking for the document within the document contact club is the
> best option?
>
> I was trying something like this:
>
> *class ClubContact (mongoengine.EmbeddedDocument):*
> * name = Stringfield ()*
> * IntField phone = ()*
> *
> *
> *Club class (mongoengine.Document):*
> * name = Stringfield ()*
> * Stringfield address = ()*
> * email = EmailField ()*
> * phone = ListField (EmbeddedDocumentField (ClubContact))*
>
> Does it make sense?
>
> --
> 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: Missing peice before best practises

2013-07-03 Thread Amirouche Boubekki
2013/7/1 Sayth Renshaw <flebber.c...@gmail.com>

>
>
> On Monday, July 1, 2013, Tom Evans wrote:
>
>> On Mon, Jul 1, 2013 at 11:37 AM, Sayth Renshaw <flebber.c...@gmail.com>
>> wrote:
>> > Is that good though?
>> >
>> > Barring 2 scoops there is no new material to recognise and guide users
>> to
>> > the new features of Django and to get beginner Django developers on
>> board
>> > quicker.
>> >
>> > It leads to bits of info for each python framework but nothing
>> > comprehensive.
>> >
>> > Sayth
>> >
>>
>> Virtualenv, pip etc are not features of Django, they are features of
>> python. It is right that Django mentions them in places, it is doubly
>> right that it does not attempt to duplicate the fine documentation
>> that pip and virtualenv possess themselves.
>>
>> Cheers
>>
>> Tom
>>
>>
> Agreed good tutorials would show steps and then point to resources for
> further reading,
>
> At this point though it appears there is a scarcity of good tutorials for
> current Django.
>

pip+virtualenv[wrapper] is a pratice not something that will allow you to
build a skyrocket as-is, you can live without it.

The documentation is good, and overall ecosystem alive and active, what do
you need more ? They are several CMS and admin apps, blog solutions etc...
They are still improvements and stabilisation to be done on many (utility)
apps... Everything I want to say is that outside the django tutorial, and
anybooks you read, the best way to improve your skills it to [re]build
something...

Time to time, I think about writring a set of tutorial about a CMS or
Social Network from scratch, but experience says that except the actual
code, the remaining issues are solved and well documented outside this
virtual project, so this would, I think, have little value.




HTH,

Amirouche

-- 
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: URL shorteners

2013-07-01 Thread Amirouche Boubekki
Héllo,

Are you looking for an API for a shorturl service or a standalone app to
make a short url service ?


Amirouche


2013/7/1 Larry Martell <larry.mart...@gmail.com>

> I'm looking for a URL shortener I can use with my django project. I
> want to be able to email a short link to someone that will expand to
> the 'real' URL. Googling I see there's quite a few different URL
> shorteners. Anyone here have any experiences with them they would like
> to share? Which one would be the best for my type of use case?
>
> Thanks!
> -larry
>
> --
> 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: django search query

2013-07-01 Thread Amirouche Boubekki
2013/7/1 Harjot Mann <harjotmann1...@gmail.com>

> On Sun, Jun 30, 2013 at 11:18 PM, Amirouche Boubekki
> <amirouche.boube...@gmail.com> wrote:
> > You can do this by creating an extra field in the model with the name
> > without vowels in it and doing a simple filter on it ? Is that what you
> need
> > ?
>
> I have a search function which is already working in views.py but I
> want to refine it.


Is this search function a query like
MyModel.objects.filter(usernamename=username, ...) or something more
specific ?


> How can I make a model without vowels??
>

the most performant solution would be to use re
sub<http://docs.python.org/2/library/re.html#re.sub>but str.replace
will work too.


> And what is django-haystack application?


Haystack is a full text search application, it build an index specific for
full text search which means it's not suited for the search you are looking
to do (also it takes a lot of memory).


> Can I use it in my project for refining search or is it a normal searching
> application?
>

It depends... can you write a query in the form of
MyModel.objects.filter(foo=bar, spam=egg) where you document each fields so
that we can know better what your are trying to achieve ? Real data is not
significant, but full scope of the problem you are trying to solve is.



Amirouche

-- 
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 search query

2013-06-30 Thread Amirouche Boubekki
You can do this by creating an extra field in the model with the name
without vowels in it and doing a simple filter on it ? Is that what you
need ?


2013/6/30 Harjot Mann 

> On Sun, Jun 30, 2013 at 10:18 PM, Scot Hacker 
> wrote:
> > This is really a question about regular expressions, not about Django.
> > Whether you implement simple or complex search in Django, whether you use
> > Django or some other platform, this is going to come down to using a
> fairly
> > complex regular expression. So I would search for "regex ignore vowels"
> and
> > similar. I would also expect performing a search like that to be
> extremely
> > expensive, computationally, since it will need to tear apart every single
> > word in the pool. That, in turn, means you'll want to use a search system
> > with very robust indexes. In fact, you might do best with a system that
> > pre-indexes all of your content without vowels.
>
>
> Yes this is exactly what I want, right now its a very simple search
> but I want it to be a very good search.Please help me.
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.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.
> 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: Is here Ella cms (based on Django) users?

2013-06-13 Thread Amirouche Boubekki
2013/6/12 Pavel <bmp1m...@gmail.com>

> thank you for review :) but i several days learn Ella
> https://ella.readthedocs.org/en/latest/features.html
> and i like it :)
>
> but i have some troubles. such as -
> https://ella.readthedocs.org/en/latest/common_gotchas.html#creating-site-navigation
> where should i paste those code? where must be placed views.py?
>


Please forward your question to ella-proj...@googlegroups.com

Good luck :)


>
> понедельник, 10 июня 2013 г., 11:22:13 UTC+4 пользователь Amirouche
> написал:
>
>>
>>
>> Le lundi 10 juin 2013 00:48:06 UTC+2, Pavel a écrit :
>>>
>>> i have some newbie questions ^^
>>
>>
>> Can you elaborate on yours needs ? They are several CMS in Django:
>>
>> - djagnocms
>> - amstrongcms
>> - mezzanine
>>
>  --
> 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: Point System in django

2013-06-13 Thread Amirouche Boubekki
2013/6/13 MattDale <mattdalesm...@gmail.com>

> A quick google didn't turn up any packages for your specific case, but you
> may not want to use a pre-built solution.
> Amirouche wanted some more information about how you plan on implementing
> the project.
>
> Here's a simple concept:
> It seems that you would want to customize the standard User model and add
> an integer field "Points" to it with default value=0.  When the User
> purchases these fictitious points, you would increment their associated
> Points value by whatever they paid for.
> Then when the User is on the site and logged in, you can use Javascript to
> send an asynchronous request to the server when the Play button is pressed
> on the page.  Since the user is logged in, it's instance is available in
> the context that was sent through in the AJAX request. You would then be
> able to subtract the corresponding point value from that User's Points
> field.
>
> Obviously my description has flaws: you need to be careful with the
> Javascript so the User doesn't click the Play button multiple times, you
> need to set rules in the User model to not allow negative Point values,
>  not allow the user to press the Play the button if they don't have enough
> Points, etc.
>

You don't have to use Javascript, you can come with a solutions that
doesn't involve javascript.

On Wednesday, June 12, 2013 1:38:45 PM UTC-4, coded kid wrote:
>
>> How do you mean? Please explain further.
>>
>> On Monday, 10 June 2013 14:05:56 UTC+1, Amirouche wrote:
>>>
>>>
>>>
>>> Le lundi 10 juin 2013 12:59:05 UTC+2, coded kid a écrit :
>>>>
>>>> what is the best way to implement this? Users will pay a certain fee
>>>> and get some amount of points (100points) and for every video the user
>>>> watch, like 30points will be deducted. How can I go about this? is
>>>> there a package for point system in django?
>>>
>>>
The point thing, make me think about badge applications but it's not, I
think, what you need [1]



>
>>> This is simple transaction scheme what is specific to your usecase ?
>>>
>>

Custom user class [2] has a field points that can be increased using some
form. Then there is another table that we can call Subscription that looks
like the following:

class Subscription(models.Model):

user = models.ForeignKey(User)
video = models.ForeignKey(Video)
end_date = models.DateTimeField()


When the user tries to play a video you check for a valid subscription
something like Subscription.filter(end_data__gt=current_date,
user=request.current_user) depending on the result you show a pay wall or
the video.

HTH,


Amirouche


[1] https://www.djangopackages.com/grids/g/awards-badges/
[2]
https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model

-- 
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: Point System in django

2013-06-10 Thread Amirouche


Le lundi 10 juin 2013 12:59:05 UTC+2, coded kid a écrit :
>
> what is the best way to implement this? Users will pay a certain fee 
> and get some amount of points (100points) and for every video the user 
> watch, like 30points will be deducted. How can I go about this? is 
> there a package for point system in django?
>

This is simple transaction scheme what is specific to your usecase ? 

-- 
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: Is here Ella cms (based on Django) users?

2013-06-10 Thread Amirouche


Le lundi 10 juin 2013 00:48:06 UTC+2, Pavel a écrit :
>
> i have some newbie questions ^^


Can you elaborate on yours needs ? They are several CMS in Django:

- djagnocms 
- amstrongcms
- mezzanine 

-- 
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's database system

2013-06-06 Thread Amirouche Boubekki
peewee  looks more like django ORM


2013/6/5 Nikolas Stevenson-Molnar 

> Have you had a look at SQLAlchemy? http://www.sqlalchemy.org/
>
> _Nik
>
> On 6/5/2013 3:29 AM, heni yemun wrote:
> > Hi,
> > I'm starting to develop some python program to address some database
> > needs- this is for desktop usage not on the web. So i was wondering if
> > django's database system can be integrated to my program instead of
> > writing the routing python database access api. I like django's easy
> > interface. 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.
> >
> >
>
> --
> 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: Selecting site in admin

2013-05-29 Thread Amirouche Boubekki
Use groups maybe this can help
http://stackoverflow.com/questions/8392780/django-admin-group-permissions-to-edit-or-view-models


2013/5/28 Mário Neto 

> Do you can this in your template
>
>
> 2013/5/28 Victor 
>
>> As a newbye I'm happily using admin.
>>
>> Now I would like to select what a user can see in the admin main page
>> according to its username just as a (non-working) example I would like to
>> follow this idea
>>
>> in admin.py
>>
>> if request.user=='victor':
>>   admin.site.register(Categorie)
>>   admin.site.register(Codiciiva)
>>   admin.site.register(Magazzini)
>> else:
>>   admin.site.register(Marca)
>>   admin.site.register(Fornitori,FornitoriOption)
>>   admin.site.register(Pazienti,PazientiOption)
>>   admin.site.register(unita_misura)
>>
>> How can I do this?
>>
>> Ciao
>> Vittorio
>>
>> --
>> 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.
>>
>>
>>
>
>
> --
> Att. *Mário Araújo Chaves Neto*
> *Programmer, Designer and U.I. Engineer*
> *
> *
> *MBA in Design Digital* - 2008 - FIC
> *Analysis and Systems Development* - 2011 - Estácio
> *D**esign and Implementation of Internet Environments* - 2003 - FIC
>
> --
> 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: [ANN] Python in the browser by Python

2013-05-10 Thread Amirouche


Le jeudi 9 mai 2013 21:09:13 UTC+2, Javier Guerra a écrit :
>
> On Thu, May 9, 2013 at 11:55 AM, Amirouche Boubekki 
> <amirouche...@gmail.com > wrote: 
> > I just released a new version of PythonScript, a "variant" of Python 
> that 
> > compiles to javascript. 
>
>
> nice!  
>

> how does it compare with Pyjamas (http://pyjs.org/) ? 
>

Pyjamas is a port of GWT. It targets both dekstop and browser, I think 
Pyjamas is a Framework in Python to Framework in Javascript translator 
whereas PythonScript takes a subset of Python (little is not supported) and 
convert it to Javascript.

Amirouche

-- 
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.




[ANN] Python in the browser by Python

2013-05-09 Thread Amirouche Boubekki
Héllo,

I just released a new version of PythonScript <http://apppyjs.appspot.com/>,
a "variant" of Python that compiles to javascript. It should be very
similar to CPython, but not the primary goal. Having something that's easy
to work with (right now), without sacryfing for speed or implementation
complexity are the primary goals.

I take the opportunity of this new release to reach Djangonauts because I
think that you might be interested.

FAQ:

*wat?)* So, how does it looks like ? Just like Python!

*demo)* What can I do with it ? Probably something, here is a mosaic of
links <http://amirouche.github.io/sudo-python/>
[source<https://github.com/amirouche/sudo-python/tree/gh-pages>
].

*100%)* Is it 100% compatible with CPython ? No, and it won't be, the only
thing that will be 100% compatible with CPython is an interpreter
translated to javascript (possible PythonScript future) or written in
Javascript (like Brython).

*django)* How does it work with Django ? Just like CoffeeScript I guess,
there is a demo app in the repository and a mini-explanation on the
website<http://apppyjs.appspot.com/#django>
.

*tldr)* I'm lazy, can I haz cheese burger ? No, but you can try the online
editor <http://apppyjs.appspot.com/editor>.

*future)* Where is it headed ? I'm looking forward building something like
Meteor <http://meteor.com/>, a backend+frontend framework, then writte an
interpreter in PythonJS [1] that is 100% compatible with CPython. If you
are interested in such a project send me an email.

*doc)* I started a bit of
documentation<https://pythonscript.readthedocs.org/en/latest/>
.

*jquery)* Does it have jQuery bindings ?
Yes<https://github.com/amirouche/PythonScript/blob/master/bindings/jquery.py>
!

*tests)* Is there any tests ? No...

*help)* How can I help ? As usual, use it, write about it, tell me if
something is wrong, do a PR, anyway notify me if you do something. Also you
can reach me directly if you want. You can also
RT<https://twitter.com/AmirAmazig/status/332525378767839233>
.

*forge)* Where is the code? https://github.com/amirouche/PythonScript

*copying)* I changed (in the develop branch) to LGPL 2.1 so it's similar to
MIT/Apache/new-BSD aka. business friendly but free software.

Cheers,

Amirouche

[1] a subset of Python that translates to a subset of Javascript used in
PythonScript to implement 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 + Raspberry PI

2013-03-07 Thread Amirouche


On Thursday, March 7, 2013 8:08:45 PM UTC+1, Amirouche wrote:
>
> http://amirouche.github.com/blog/cross-compiling-a-gentoo.html
>

This will be a long way home for you I recommend you setup a cross compiler 
and use distcc 

-- 
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 + Raspberry PI

2013-03-07 Thread Amirouche
http://amirouche.github.com/blog/cross-compiling-a-gentoo.html

On Thursday, March 7, 2013 8:05:50 PM UTC+1, Amirouche wrote:
>
>
>
> On Friday, March 1, 2013 5:04:47 PM UTC+1, Shawn Milochik wrote:
>>
>> Yep, I got my full development environment for one of my company's 
>> applications running on it with almost no problem. The one exception 
>> was MongoDB, which is for x86 only, so I had to compile a fork, which 
>> took about 10 hours on the Pi. 
>>
>> It was definitely pretty slow, but it works. 
>>
>> Our stack includes nginx, gunicorn, Redis, MongoDB, PostgreSQL, 
>> supervisor, virtualenv, and probably other stuff I'm forgetting. 
>>
>> It is a computer, after all. Just slow, not too much RAM, and with an 
>> ARM processor. 
>>
>
> Slow ARM processor.
>
> Did you try to cross compile mongodb or use qemu chroot/proot ?
>
> Here is an explaination on how to cross build a gentoo from another gentoo 
> and and an environnement setup to do be able to qemu proot and compile 
> anything (as if it was compiled on the raspberry)... I divides by 6 the 
> time needed to compile raspberry pi kernel with modules (less than 1hour) 
> and you get all the benefit of a source distribution :) 
>
> If you don't use a gentoo you can setup portage prefix or chroot.
>
> OR 
>
> you can use distcc with a cross compiler.
>
> HTH,
>
> Amirouche
>  
>

-- 
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 + Raspberry PI

2013-03-07 Thread Amirouche


On Friday, March 1, 2013 5:04:47 PM UTC+1, Shawn Milochik wrote:
>
> Yep, I got my full development environment for one of my company's 
> applications running on it with almost no problem. The one exception 
> was MongoDB, which is for x86 only, so I had to compile a fork, which 
> took about 10 hours on the Pi. 
>
> It was definitely pretty slow, but it works. 
>
> Our stack includes nginx, gunicorn, Redis, MongoDB, PostgreSQL, 
> supervisor, virtualenv, and probably other stuff I'm forgetting. 
>
> It is a computer, after all. Just slow, not too much RAM, and with an 
> ARM processor. 
>

Slow ARM processor.

Did you try to cross compile mongodb or use qemu chroot/proot ?

Here is an explaination on how to cross build a gentoo from another gentoo 
and and an environnement setup to do be able to qemu proot and compile 
anything (as if it was compiled on the raspberry)... I divides by 6 the 
time needed to compile raspberry pi kernel with modules (less than 1hour) 
and you get all the benefit of a source distribution :) 

If you don't use a gentoo you can setup portage prefix or chroot.

OR 

you can use distcc with a cross compiler.

HTH,

Amirouche
 

-- 
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 superstars I should be following?

2013-02-07 Thread Amirouche


On Tuesday, February 5, 2013 9:51:17 PM UTC+1, Glyn Jackson wrote:
>
> I'm looking for suggestions on who to follow on twitter. 
> Who are the Django superstars, and the opinionated and guy/grils I should 
> be following?
>

Me  of course... 

Github following is interesting too but I keep that a secret of mine.

Good luck!

 

>
> :) 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: How to deploy Django apps with Google App Engine

2013-01-20 Thread Amirouche
Héllo Harit,

On Friday, January 18, 2013 6:56:17 PM UTC+1, Harit wrote:
>
> Hello Everyone

 

> I am new user of Django and this community and want to know how can we 
> deploy Django apps on Google App Engine.
>

If it is Google App Engine and not Google Cloud you won't be able to use 
Django's ORM aka. models like Londerson said, you will have to use 
something like django-nonrel or skip it all together and just use GAE ndb 
which means you won't be able to reuse existing django applications (or 
contrib apps). If you really need to use django models I recommend you use 
Google cloud which comes with a mysql database (cloud sql).
 

> Are there Easy, Simple ways to accomplish it?
>

Except the above, it similar to how other cloud solutions works. 

Regarding the packaging of your project, you have to put every dependency 
in the directory you push in the cloud with settings files, static et al. 
This probably include Django's django directory in the correct version 
since the available version might not be the good one. I don't know any 
project template for Django (!), but there are for Flask, here is an 
example one [0], It should be pretty similar.

Heroku and Google cloud solutions are similar in feature, the pricing and 
SLA should be decision makers. Also they are another cloud service which I 
heard good things namely dotcloud [1] which supports Django [2] out of the 
box and a certain number of other foss like solr, rabbitmq...
 

>
> Please guide me through your experiences, resources that you are aware of
>

When I used Google Appengine but with flask, because I wanted to learn 
flask and google appengine... AppEngine is easy to work with but you end 
up dependent of the infrastructure even if they are now several similar 
foss PAAS appengine compatible [6]. It's true that the experience of webdev 
is well integrated and streamlined for some common [3][4][5] tasks but it 
is worth the price since AFAIK there is nothing you can't do outside of 
Google...?


[0] https://github.com/kamalgill/flask-appengine-template
[1] https://www.dotcloud.com/
[2] http://docs.dotcloud.com/0.9/tutorials/python/django/ 
[3] https://developers.google.com/appengine/docs/python/search/overview
[4] 
https://developers.google.com/appengine/docs/java/multitenancy/multitenancy
[5] https://developers.google.com/appengine/docs/python/taskqueue/
[6] http://en.wikipedia.org/wiki/Google_App_Engine#Portability_concerns

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/qJhlFGi7pTsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django lucene

2013-01-18 Thread Amirouche Boubekki
Héllo,

I'm curious why do you use lucene instead of solr ?

Thanks


2013/1/18 Harry Houdini 

>
> I originally went down this path but I too ran into many problems getting
> this to work and ended up using Whoosh instead. The site was small ~30
> pages or so it was still pretty fast. I had it index by reading the sitemap
> and pulling down the page content from the web server. I used
> BeautifulSoup4 to get the page title to store in the Whoosh DB. Anyway,
> just another option to consider.
>
>
>
> On Tuesday, August 25, 2009 10:55:59 AM UTC-4, Puneet wrote:
>
>> Hi,
>>
>> Does anyone have tried django-lucene module for search ??
>>
>> I am able to compile the lucene and jcc as  required but the module is
>> not working properly as it is expected to work.  As mentioned in the
>> docs I have added to fields in my model
>>
>>objects = models.Manager()
>>objects_search = Manager() # add search manager
>>
>> But when I say ModelName.save() its not getting indexed with lucene
>> and when I say
>>
>>  ModelName.objects.objects_**search(name_first="Spike")
>>
>> I am getting error that
>>
>> AttributeError: 'Manager' object has no attribute 'objects_search'
>>
>> Can any one help me with this ?? Does anyone have a small working
>> example ?
>>
>> Thanks,
>> Puneet
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Ys0rcBWSMp0J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: django: creating tag groups

2013-01-15 Thread Amirouche Boubekki
> Why are you creating two groups of tags ? Why not use a specific widgets
>> like a tree widget ?
>>
>
> Great idea! Think, I'll give this a try.
>

It's not the same UX though...


>
> Are you sure you use the good parameter to pass the queryset to the
>> underlying Field
>>
>
> It's just an example with the same queryset for both fields.
>

The example in the code is not working, «My» class is not referenced
anywhere. I'm not familiar with multi-widgets but if a tree widgets is not
what you want or don't get it work, I think it's the right approach.

Amirouche, thank you for your answer, I really appreciate your help.
>

;)

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



Re: django: creating tag groups

2013-01-14 Thread Amirouche
Why are you creating two groups of tags ? Why not use a specific widgets 
like a tree widget ?

On Monday, January 14, 2013 12:02:59 PM UTC+1, Sammael wrote:
>
> *The models*
>
> class TagGroup(models.Model):
> name = models.SlugField(max_length=50, unique=True, db_index=True)
>
> class Tag(models.Model):
> name = models.SlugField(max_length=50, unique=True, db_index=True)
> group = models.ForeignKey(TagGroup)
> def __unicode__(self):
> return self.name
>
> class Album(models.Model):
> name = models.CharField(max_length=64, blank=True)
> tags = models.ManyToManyField(Tag, blank=True)
>
> *The idea* is to have some groups of tags, for example, season (with the 
> following tags: winter, summer, etc.) and place (with tags like Europe, 
> America) for each album.
>
> *The problem* is I can't find a way to have a separate form for each 
> group of tags in Django Admin.
>
> I've been reading docs for many hours trying to find the solution and here 
> is where I come.
>
>
> *First approach*
>
> First of all I decided to create a separate form for tags:
>
> class AlbumAdminForm(forms.ModelForm):
> class Meta:
> model = Album
> tags = forms.ModelMultipleChoiceField(queryset=Tag.objects.all(), 
> required=False, widget=FilteredSelectMultiple('tags', False ))
>
> class AlbumAdmin(admin.ModelAdmin):
> form = AlbumAdminForm
>
> It works good. Trying to add another form like this:
>
> class AlbumAdminForm(forms.ModelForm):
> class Meta:
> model = Album
> tags = 
> forms.ModelMultipleChoiceField(queryset=Tag.objects.filter(group = 1), 
> required=False, widget=FilteredSelectMultiple('tags', False ))
> tags_2 = 
> forms.ModelMultipleChoiceField(queryset=Tag.objects.filter(group = 2), 
> required=False, widget=FilteredSelectMultiple('tags', False ))
>
> In this case I see two forms in django admin with tags I can select, but 
> can't save the contents of the second form because of it's property name 
> 'tags_2' - django relies on this name. Unfortunately, I didn't find any way 
> to make this form use Album.tags to save it's values.
>
> *Second approach*
>
> As far as I couldn't find the right way with AlbumAdminForm itself I 
> decided to change html code it generates. First form looks like this:
>
>  id="id_tags">
> 
> addEvent(window, "load", function(e) {SelectFilter.init("id_tags", 
> "tags", 0, "/static/admin/"); });
> 
>
> I was trying to make the second one as similar as possible, but the only 
> thing I could change is it's id:
>
>
> class AlbumAdminForm(forms.ModelForm):
> class Meta:
> model = Album
> tags = 
> forms.ModelMultipleChoiceField(queryset=Tag.objects.filter(group = 1), 
> required=False, widget=FilteredSelectMultiple('tags', False ))
> tags_2 = 
> forms.ModelMultipleChoiceField(queryset=Tag.objects.filter(group = 2), 
> required=False, widget=FilteredSelectMultiple('tags', False ))
> def __init__(self, *args, **kwargs):
> super(AlbumAdminForm, self).__init__(*args, **kwargs)
> self.fields['tags_2'].widget.attrs['id'] = 'id_tags'
>
> I couldn't change it's name or 'SelectFilter.init' call. Don't know if it 
> would be any useful if I could. So, still no luck.
>

I think that it would be useful. maybe try widgets 
attrs
 

>
> *Third approach*
>
> Trying to use MultiWidget and MultiValueField:
>
> class My(object):
> def __init__(self, val1=EmptyQuerySet(), val2=EmptyQuerySet):
> self.val1=val1
> self.val2=val2
>
> class MyWidget(widgets.MultiWidget):
> def __init__(self, attrs=None):
> widget = (
>FilteredSelectMultiple('tags1', False),
>FilteredSelectMultiple('tags2', False)
>)
> super(MyWidget, self).__init__(widget, attrs=attrs)
> def decompress(self,value):
> if value:
> return value.val1 + value.val2
> return None
>
> class MyField(forms.MultiValueField):
> widget = MyWidget
> def __init__(self, required=True, widget=None, label=None, 
> initial=None, help_text=None, queryset=None):
> field = (
>  ModelMultipleChoiceField(queryset=queryset),
>  ModelMultipleChoiceField(queryset=queryset)
>  ) 
> super(MyField, self).__init__(fields=field, widget=widget, 
> label=label, initial=initial, help_text=help_text)
>
> class AlbumAdminForm(forms.ModelForm):
> class Meta:
> model = Album
> tags = MyField(queryset=Tag.objects.all())
>
> In this case I have two forms but both are empty, I have nothing to 
> choose. No luck =(
>

Are you sure you use the good parameter 

Re: Anyway to use innovaeditor in admin?

2013-01-14 Thread Amirouche
look at tutorials about other wysiwyg editors and django like the ck 
editor

On Monday, January 14, 2013 3:39:36 PM UTC+1, frocco wrote:
>
>  src='scripts/innovaeditor.js'>
>
> Initialize the Editor below any ** you’d like to replace.
>
> 
> 
> var oEdit1 = new InnovaEditor("oEdit1");
> oEdit1.width = 750;
> oEdit1.height = 530;
> oEdit1.groups = [
> ["group1", "", ["Bold", "Italic", "Underline", "FontDialog", 
> "ForeColor", "TextDialog", "RemoveFormat"]],
> ["group2", "", ["Bullets", "Numbering", "JustifyLeft", 
> "JustifyCenter", "JustifyRight"]],
> ["group3", "", ["LinkDialog", "ImageDialog", "YoutubeDialog", 
> "TableDialog", "Emoticons"]],
> ["group4", "", ["Undo", "Redo", "FullScreen", "SourceDialog"]]
> ];
> oEdit1.css = "styles/default.css";
> oEdit1.REPLACE("txtContent");
> 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/1Bjyu976xmgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Project Structure - Lots of scattered custom views

2013-01-14 Thread Amirouche


On Monday, January 14, 2013 3:46:54 PM UTC+1, chad petzoldt wrote:
>
> It had occurred to me that Django wasn't the right tool for this job - 
>> not everything is a nail :) 
>
>
> I am embedding these files within a template, so they are not direct 
> static serves. But the content must be inserted within the template "as-is" 
> from the filesystem.
>

If you use django templates of course you need django they are other 
solutions, like Jinja2 which as no dependency on Django. The question is 
what do you really need to use in Django.
 

>
> I suck at Javascript. 
>

It can stay as is but it can also change ;)
 

>
> Perhaps still, Django is not proper for the job, 
>
 

> but I do know that I need some server-side logic, and I want to do it in 
> Python. 
>

Yes, but what is this server side logic ? forms ? even if they are forms on 
your site you don't need to use Django to serve static files via templates.
 

> Any recommendations on another framework?
>

Maybe, but your usecase is vague to me.
 

> There are aspects of Django that are growing on me,
>

What are those ?
 

> this one paradigm is where I am struggling, and I would not like to 
> abandon just yet.
>

Don't try to feet a solution to any problem, your problem might have better 
solutions outside of Django, the thing is I don't understand your project 
enough to say, yes or no to Django for you.

 

> To recap one of my original statements; I do believe what I am really 
> looking for is a content management system
>

A CMS where there is no admin and editing ? 
 

> I just don't feel ready to commit (maybe I need to get over that).
>

You are wrong about that, getting a CMS with Django is not that a endeavor 
especially if the CMS is for particular use case...

I want a content management system that focuses more on the "client 
> experience" in the browser. 
>

What does it mean ? You want javascript things ?
 

> It needs to be picky about layouts, and aware of embedded media. 
>

This can be done with both specific models or a Wysiwyg editors but I 
though there were no editing after the initial templating which makes the 
model or wysiwyg approach useless, except if you are looking for making it 
possible for the designer and editors to build a website like it's done in 
jetstrap <http://jetstrap.com/>. But this is not a CMS, it's a website 
creator.
 

> NOTE: My site layouts are not "liquid" at all. They are very absolute; 
> from dimensions to positioning. Its not just about getting all the content 
> on the page in a certain order.
>

This has nothing to do with layouts. The question is: is there any patterns 
in theses layouts ? What are those patterns ? 

If all you need is a template engine and want to avoid javascript which 
might not be accessible, you might create your own static site generator 
based on Jinja2. Look at Pelican for an example app that does static blog 
generation from rst files and templates files. Of course if you don't need 
the rst part you can skip it.

Best regards,

Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/trOqWwTM0QoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I call a query set from views.py

2013-01-13 Thread Amirouche Boubekki
Héllo frocco,


2013/1/13 frocco 

>
> in models.py
>
> def get_categories(self):
> return self.objects.filter('category_class <> "sales'
>

Use classmethod
decoratorto
achieve that, like this:

@classmethod
def get_categories(cls):
return cls.objects.filter(category_class='sales')

I replaced self by cls since the first argument is now the class. Also the
filter query is not correct, you have to use
exclude
.

Mind the fact that this is not very django way of doing queries, using
class methods or similar DAO pattern is not the most often used method to
do querying with ORMs (AFAIK). Most of the time queries are inlined in the
view or other code like this:

def view(request):
queryset = Category.objects.exclude(category_class='sales')
context = Context({'title': 'Search', 'form': form, 'data': data})
return render_to_response('index.html', context)

If you use very often this queryset you might want to create a manager for
it, read the documentation regarding
managers
.


>
> in views.py
>
> data = Category.get_categories()
>  context = Context({'title': 'Search', 'form': form, 'data': data})
> return render_to_response('index.html', context)
> this is not working.
>
>

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



Re: Django Roles/Permissions

2013-01-13 Thread Amirouche
Héllo Chung,

Did you have a look at https://github.com/lukaszb/django-guardian#usage it 
adds user permissions for objects, I don't know how it works with a Django 
1.5 though.

Regards

On Sunday, January 13, 2013 1:39:45 AM UTC+1, Chung Wu wrote:
>
> Hi there,
>
> I am having difficulty figuring out how to structure the following problem:
>
> Users have different roles/groups:
>
> Admin, Manager, Author
>
> Admins can edit every user, can view list of all users, delete all users
> Manager can edit all users who are not admins or managers, ""
> Author, can only edit themselves, view themselves
>
> Users are associated with Posts
>
> The posts would follow the same logc
>
> Authors can only see posts they have created, Edit them etc
>
> Is there a generic way to do this?
>
> Currently I have views that list all users, post etc but how would I 
> integrate roles/permissions to filter the lists, prevent the user for 
> editing others etc.
>
> Hope you can point me in the right direction
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ChcNGgHMIlUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Project Structure - Lots of scattered custom views

2013-01-13 Thread Amirouche
Héllo again,

I don't see where Django makes things easier for you at all. Why no just 
use static files and include a menu via Javascript and serve all the thing 
like static files instead of using Django ?

Regards

On Friday, January 11, 2013 7:34:00 PM UTC+1, chad petzoldt wrote:
>
> Sanjay, you were hitting things pretty close. I think that making sure 
> slug names match up to real *static* locations is the key. I am hosting 
> with Apache, and I thought about using some configurations to cheat a 
> little bit, and get some of the static-files burden off of Django and let 
> Apache resolve any requests that point to actual files on disk (with some 
> security in mind).
>
> What about a view that can determine if it should be pointing at a file on 
> disk, and if so, do a custom Http_Response, and read the actually binary 
> contents from disk by hand. Im just curious on this one; it could be an 
> alternative means of file storage and recognition. I understand this may 
> have some performance implications, but this is not going to break Django, 
> correct? Is this bad Django etiquette?
>
> Amirouche, a different way to describe what I am trying to achieve might 
> be this: I would like to bypass the admin as much as possible when it comes 
> to these "Articles". But when rendered, all of these articles do need at 
> least a small HTML wrapper, and probably some kind of of global template 
> that helps with navigation. If I could handle navigation without the admin, 
> i would be very excited, but it does seem that I will need to use the admin 
> for at least this purpose. The navigation would probably help render 
> hierarchical  "menus" for use as templates within the Articles. I would 
> like to keep this navigation as light as possible.
>
> Thanks for the feedback.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/THu33epzI2gJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: CSRF Verification error appeared after I changed DNS

2013-01-08 Thread Amirouche


On Wednesday, January 9, 2013 3:21:08 AM UTC+1, Saqib Ali wrote:
>
> Yes, I checked my cookies and there is a csrftoken: 
> jrQ4T0IZPqFpbjoPLlzJSnsEPQxzHAJh
> I didn't change the SESSION_COOKIE_DOMAIN value. There is no such setting 
> in my settings.py.
>
>
I don't know then : /

Maybe restart gunicorn or whatever runs django...
 

> I did no
>
> On Tuesday, January 8, 2013 8:09:03 PM UTC-5, Amirouche wrote:
>>
>> Did you check your cookies, is there any csrftoken ?
>>
>> Did you change SESSION_COOKIE_DOMAIN ?
>>
>> On Wednesday, January 9, 2013 1:19:35 AM UTC+1, Saqib Ali wrote:
>>>
>>> BTW, I forgot to mention that my template contains the following HTML:
>>>
>>> {% csrf_token %}
>>>
>>> E-mail:>> type="text" class="required" name="email" maxlength="75" />
>>> 
>>> 
>>>
>>>
>>>
>>> On Tuesday, January 8, 2013 6:44:49 PM UTC-5, Saqib Ali wrote:
>>>>
>>>>
>>>> Hi.
>>>>
>>>> I have been using Django successfully for a few days now. I was running 
>>>> my django application on an Amazon Web Service machine. 
>>>> I was assigned some arbitrary DNS name that looked like this: 
>>>> http://ec2-XXX.XXX.XXX.XXX.compute-1.amazonaws.com.
>>>> My Django app was working find with my model and several views with 
>>>> templates.
>>>>
>>>> Last night, I went out and bought a real DNS name from register.comand 
>>>> have that DNS name now pointing to my django application.
>>>> Since I made that change however, when I submit my django form, I get 
>>>> the following CSRF error:
>>>>
>>>>
>>>> Forbidden (403)
>>>>
>>>> CSRF verification failed. Request aborted.
>>>>
>>>>
>>>>
>>>> I tried clearing the cookies in my browser, but that didn't help. I 
>>>> even tried it from other machines that I had never tried before. But still 
>>>> the same problem.
>>>>
>>>> Why did assigning a new DNS name for this IP address cause this CSRF 
>>>> error? And how do I get rid of it?
>>>>
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/AYFEJ1viWPMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: CSRF Verification error appeared after I changed DNS

2013-01-08 Thread Amirouche
Did you check your cookies, is there any csrftoken ?

Did you change SESSION_COOKIE_DOMAIN ?

On Wednesday, January 9, 2013 1:19:35 AM UTC+1, Saqib Ali wrote:
>
> BTW, I forgot to mention that my template contains the following HTML:
>
> {% csrf_token %}
>
> E-mail: type="text" class="required" name="email" maxlength="75" />
> 
> 
>
>
>
> On Tuesday, January 8, 2013 6:44:49 PM UTC-5, Saqib Ali wrote:
>>
>>
>> Hi.
>>
>> I have been using Django successfully for a few days now. I was running 
>> my django application on an Amazon Web Service machine. 
>> I was assigned some arbitrary DNS name that looked like this: 
>> http://ec2-XXX.XXX.XXX.XXX.compute-1.amazonaws.com.
>> My Django app was working find with my model and several views with 
>> templates.
>>
>> Last night, I went out and bought a real DNS name from register.com and 
>> have that DNS name now pointing to my django application.
>> Since I made that change however, when I submit my django form, I get the 
>> following CSRF error:
>>
>>
>> Forbidden (403)
>>
>> CSRF verification failed. Request aborted.
>>
>>
>>
>> I tried clearing the cookies in my browser, but that didn't help. I even 
>> tried it from other machines that I had never tried before. But still the 
>> same problem.
>>
>> Why did assigning a new DNS name for this IP address cause this CSRF 
>> error? And how do I get rid of it?
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/4iEX7t7Wt3kJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Documentation of app_directories.Loader

2013-01-08 Thread Amirouche
Héllo Per-Olof,

On Saturday, January 5, 2013 4:17:14 PM UTC+1, Per-Olof Åstrand wrote:
>
> I had a problem interpreting the documentation of app_directories.Loader 
> in 
> https://docs.djangoproject.com/en/dev/ref/templates/api/#loading-templates(I 
> use the dev version of Django). As I read the documentation, I should 
> put the templates for an app in
>
> app_name/templates/*.html
>>
>
>
Yes, it should work if you reference the template *without* the app_name 
for instance 

{% extends "base.html" %}
{% include "footer.html" %}

or in python with «render(request, "base.html", ctx)» but you never render 
the base html or footer directly so this is dummy example
 

> whereas to get it to work, I had to put them in
>
> app_name/templates/app_name/*.html
>>
>

it only works if you reference the app_name when you call the template for 
instance «render(request, "app_name/index.html", ctx)» same for include and 
extends.

It's a convention to avoid clash between templates names, it a way to 
namespace templates, otherwise you would need to namespace the names of the 
templates like: «app_name_index.html» which is not nice...


> It also seems like it looks for templates in (which I could see from the 
> error message when failing with the first approach)
>
> app_name1/templates/app_name2/*.html
>
>
> I can see the power of that when having a hierarchy of apps. Am I missing 
> something here?
>
> Per-Olof
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/K3jp_MpGpEIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Project Structure - Lots of scattered custom views

2013-01-08 Thread Amirouche
Héllo Chad,

I'd like to help but I need more infos if you don't mind and is granted to 
provide them.

On Monday, January 7, 2013 9:52:35 PM UTC+1, chad petzoldt wrote:
>
> Right now my project only has 2 apps that use a database (*real* apps). 
> The rest of the website is composed of many custom views, scattered all 
> over the place. I am new to Django, and I havn't quite figured out how to 
> structure my project directory just yet.
>

What do this two apps ?

The other *issue* is related to my design/develop workflow. Working 
> completely through an internet browser just isnt possible for 80% of the 
> project cycle. We have many programs which want to work directly on the 
> filesystem (on an offline machine), mostly coming from the Adobe Creative 
> Suite.
>

I don't understand this part, are you programming in the browser ? or is it 
just about the design phase of each «Articles/bundle», work prior or in 
parallel of programming the site ?
 

> There are all kinds of media documents and markups forming "Articles". 
> These Articles are passed around as bundles during design, and then when 
> they get to me I have to tie them together very neatly and push them onto 
> the website. The one thing I do have control over is the Url layout, and 
> the navigation of these articles.
>

> Should I be splitting each of these "articles" into their own apps (a 
> directory with little more than 'templates/' and 'static/'). 

 
I'm not sure but what you describe looks like a (e)magazine with several 
issues (you call them Articles/bundle) where each issue has it's own 
layout/design - and probably navigation but it seems also there is a global 
menu - a cross issues menu - present on all issues.

This makes synchronization easy with the server, there is no database 
> interaction required;


I assume by «synchronization» you mean «putting the new "Articles" in 
production».
 

> the only task left after the sync is for me to update my navigation 
> widgets (which I currently just do by hand). 


Can you describe this navigation widget ? Is it available over all 
apps/Articles/issues ?

Do the Articles gets modified after the first synchronization ? Do you have 
somekind of administration to edit them ?

In the other mail you say «But I still find myself creating bare apps with 
some crazy model defined that only has 1 table row.», could you describe 
one of this table/row and generalize to the other similar tables ?

Regards,

Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/UoXiPGxq-FIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: sort cache

2013-01-08 Thread Amirouche
Héllo psychok7,

On Tuesday, January 8, 2013 1:45:07 PM UTC+1, psychok7 wrote:
>
> Hi guys, just wondering if its possible to sort a django cache? I need to 
> add data with an auto increment id to the cache and sort it in reverse 
> order to get it back. I no this can be easily accomplished with the normal 
> mysql database but since the cache is faster i would like to do it there


Yes and no.

Django cache backend alone can't do this sort of things, the only methods 
that are 
definedare:

- get
- get_many
- set
- set_many
- incr
- decr
- delete
- delete_many

With those, you can do what you want, you have to set up a «schema» with 
cache keys that will allow you to do what you want.

Similarly you can also do this sort of things using 
redis, 
which is also pretty fast since it's also a in memory key/value store, 
using higher level methods on higher level data structures like lists, 
sets, sorteds sets, hashes. You might as well fallback on creating your own 
data structures relying on existing datastructures usings 
scripts
.

The usecase you are discribing is not clear, why not just do the sorting 
with mysql, store in the cache with an expiration key the results, ids or 
rendered templates ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/izl57HRb4YUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django admin

2013-01-07 Thread Amirouche
Héllo Elton,

have some tutorial about django admin? i would customize him...
>
> I wanna make a CRUD for study and customize the admin's views and models...
>
 

> there some tutorial for this?
>
> * i'm using the version 1.4
>
> Thanks!
>

I don't know any particular tutorial regarding the admin, it is well 
documented <https://docs.djangoproject.com/en/dev/ref/contrib/admin/>, what 
you need I think is a particular project for which to build an admin for. 
It can be a CMS for instance. What you can do is also integrate front 
design in the admin which is template and css work.

Regards,

Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/qN_u2T5HHhUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Architectural question - decoupling modules but keeping some interaction

2013-01-07 Thread Amirouche
Héllo Roodie,

On Monday, January 7, 2013 4:44:05 PM UTC+1, Roodie wrote:

> Hello, what I am looking for is some pointers/articles about a fully 
> modularized architecture, where some of the functionality could depend on 
> an existence of a model in a given project. We are (re)building one of our 
> portal applications, and I would like to fully modularize it.
>
> Just a little example. Let's assume that the portal engine has an 
> 'article' module, and a 'gallery' module. If a specific installation has 
> the privileges for both modules (there are feauture switch apps for this 
> part fortunately) then the editors can attach galleries to the articles in 
> the admin. Same with the 'downloads' module, utilizing it they can attach 
> files to the articles. So far so good, a simple model with some generic 
> relations could solve the problem. 
>
> But then we add a new module/content type, let's call it 'events'. Both 
> the galleries and files should be attachable to this new content type also.
>
> That's the goal I would like to achieve - decouple the modules, but keep 
> the possibility of interaction between them. Are there any open source 
> projects using a similar architecture to look at? Or any articles, 
> examples, I would be grateful for any pointers really, because right now I 
> am stuck here. The only idea I have so far is to create an abstract base 
> class from which all the content types would be extended, and use some 
> custom managers (to check if a given feature is enabled or not) to 
> implement the feature, but I am not 100% convinced it is the right path. 
> Any ideas or 
>

What you are looking for is an admin application that pulls the actions 
available on a particular model for a particular user based on the presence 
of another model and a set of permissions. Is it correct? Then the front is 
also some how dynamic it must have a way to pull all the «content» 
dependencies and render them.

The front you can use something similar to this<https://gist.github.com/4476673>
.

For the backend, the admin can do that, you will need to tweak a bit the 
admin so that it renders the correct form (or formset) depending on the 
user permissions.  

If this is correct, I don't know any app or framework that does what you 
are looking for in generic way except the admin with tweaking, but it could 
be fun to do ;)

Regards,

Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/gAnrROVytEcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Question about URL namespaces

2013-01-07 Thread Amirouche
*tl;dr* if you do not reuse the same django application several times it is 
not useful.

The following is a messy don't hesitate to ask for clarification so that me 
or someone else can contribute more documentation regarding this topic, 
there is probably more than that but that's what I understood.

On Wednesday, January 2, 2013 9:28:06 AM UTC+1, Dae_James wrote:
>
> So what does instance actually mean here?


To understand instance you need to understand *application* *in the urls*.
 

>  Does it just mean another copy of the app directory with a different 
> directory name?
>

No, it's just about urls and views, it's *another copy of the urls* and 
notably any model mechanics should be handled separatly (!) (I explain 
below how it can be done). «application_namespace» can possibly be 
something else that the (generic) application name, it is actually refering 
the an application in the website point of view not the code point of view, 
even if most of the time those are the same. It can be something else when 
you have a set of urls for one application say you have a favorite 
application it has two set of urls:

- navigation of favorites: list, detail, search views, every users has 
access to those urls 
- private favorites handling: add, change, delete and also probably list, 
search and detail with specific UI to edit a favorite, the page served by 
this urls are specific to the current user

So, given the above setup you can have two application namespaces 
«favorites-public» and «favorites-user» in one «django application» see [0]

It makes sens to have two urlpatterns in the generic app because you can 
hook them separatly in the url router.


> 在 2012年12月30日星期日UTC+8上午3时06分03秒,Ryan Blunden写道:
>>
>> I've never used this feature but I believe it was created so that for a 
>> single Django project, you could provide multiple administration apps. For 
>> example, you might have one for customers and one for back office staff 
>> that expose different models, have different permissions etc.
>>
>
Yes, it used by the admin because it wants to be generic and be reusable 
thus generic apps should also use namespaced urls see [0] it is not admin 
specific, application_namespace and instance_namespace are used in 
different situations:

- application_namespace removes the need to namespace url names like it was 
done before, for instance the index would be named «admin-index» and every 
view will need to use the same scheme because if the admin urls are 
included in another app it could clash with other named urls, instead now 
you use the include(urlpatterns, application_namespace, instance_namespace) 
you can keep the url names sane and still profit from namespacing offered 
by the include. Hence, IMO, application_namespace should be provided by the 
generic app developper.

- instance_namespace should be set by the user of the application when he 
or she wants to refer to a particular instance of the urls, say you include 
twice the admin appplication you have to provide an instance_namespace if 
you want to be able to refer to one or the other admin app. Before 
namespaces it was not possible to reuse the application urlpatterns, you 
had to rebuild all the patterns with names like «customer-admin-index» and 
«manager-admin-index» 

Regarding the 
reversethe
 documentation is not laking I think but I made an mini-example app as 
an urls.py file that you can drop as your projects 
urlsso that you can experiment with it, the 
output is:

If no current_app is provided, reversing by application_namespace will 
match the last included url
   
   - reverse(app_ns:one, current_app=None): /app/instance_three/one
   - reverse(app_ns:two, current_app=None): /app/instance_three/two

If you set current_app to an instance_namespace it reverse to the *current 
instance* of the application namespace
   
   - reverse(app_ns:one, current_app=instance_ns_two): /app/instance_two/one
   - reverse(app_ns:two, current_app=instance_ns_two): /app/instance_two/two

If you reverse using *instance_namespace* whatever the current_app it will 
be resolved to the instance url
   
   - reverse(instance_ns_one:two, current_app=instance_ns_one): 
   /app/instance_one/two
   - reverse(instance_ns_one:two, current_app=instance_ns_two): 
   /app/instance_one/two
   - reverse(instance_ns_one:two, current_app=instance_ns_three): 
   /app/instance_one/two

Gotcha I think, when urls are namespaces you can't resolve them without a 
namespace, in this example for instance reverse('one') raise an 
UnresolvedUrl exception (at least without current_app...)

 

> So to answer your question about what "application" means in this context, 
>> it means a Django application (e.g. django.contrib.admin).
>>
>
Yes and no, most of the time it's true but not all the time, it's 
«application» from a website perspective, not django code 

Re: Happy new year

2013-01-01 Thread Amirouche
Bonne année, paix et prosperités!

Amirouche from Paris, FRANCE.

On Monday, December 31, 2012 10:42:13 PM UTC+1, cingusoft wrote:
>
> Happy new year from spain to all django lovers. 
> I wish you a new year with tons of django projects. 
>
> Cheers 
> Cingusoft 
> BlackBerry de movistar, allí donde estés está tu oficin@

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/He2t7vHzrBAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Replicating same model for different deployed application.

2013-01-01 Thread Amirouche


On Sunday, December 30, 2012 7:43:11 PM UTC+1, Subodh Nijsure wrote:
>
>
> Exactly I was missing the django/web app terminology of multi-tenant app. 
>

I think, it's a software terminology, it isn't particular to web or django, 
but I encountered only in web.
 

>
> I tried using https://github.com/phugoid/django-simple-multitenant and it 
> seems to have issues. I will see if I can fix them with my limited 
> knowledge of django.
>
> Are there any good multi-tenants frameworks for django out there, any 
> recommendations?
>

There is also the 
django.contrib.site<https://docs.djangoproject.com/en/dev/ref/contrib/sites/>that
 can be helpful, you might also be interested in a search about «django 
subdomains».


Amirouche
 

>
> Regards,
> -Subodh
>
> On Sun, Dec 30, 2012 at 8:57 AM, Amirouche 
> <amirouche...@gmail.com
> > wrote:
>
>> Héllo Subodh
>>
>>
>> On Sunday, December 30, 2012 3:57:36 AM UTC+1, Subodh Nijsure wrote:
>>>
>>> Hi,
>>>
>>> I have following situation where. My model consist of say table1, 
>>> table2, table3. 
>>>
>>> I am going to "host" similar data and associated web interface for 
>>> multiple customers -( customer1, customer2, customer3.) they would access 
>>> these application as http://hostname/customer1 http://hostname/customer2etc.
>>>
>>> When customer1 application is deployed I want tables customer1_table1, 
>>> customer1_table2, customer1_table3 to be created. Same for customer2, 3 etc.
>>>
>>> Right now I am thinking of having one "template" directory where all 
>>> database names are referred to as replaceme_table1, replaceme_table2 etc.
>>>
>>> When I actually deploy application for real customer say customer1 I am 
>>> copying this template to directory customer1 and running sed to  change 
>>> 'replaceme' with 'customer1' 
>>>
>>> Is there a better, elegant way to do this in django where you have same 
>>>  model that needs to be deployed as multiple django applications?
>>>
>>
>> If I understand this is a multitenant application or multitenancy for 
>> short, one django instance for several customer. They are several 
>> application that are labeled like that, I can't recommend any in particular 
>> since I don't use it them.
>>
>> Regards,
>>
>> Amirouche
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/_np6wETOfSwJ.
>>
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/8K8rWUmvNlYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Amirouche


On Saturday, December 29, 2012 9:42:50 PM UTC+1, Sam Raker wrote:
>
> Here's the truncated version I tried to load in case the problem was the 
> length of the file:
> - fields: {location: ST. DENNIS HOTEL, restaurant: Veterans American 
> Guard, status: complete,
> year: 1900}
>   model: dishes.menu
>   pk: 12495
> - fields: {location: BOSTON, restaurant: New England Shorthand Reporter's 
> Association,
> status: complete, year: 1900}
>   model: dishes.menu
>   pk: 12563
> - fields: {location: RMS LUCANIA, restaurant: Cunard Line, status: under 
> review, year: 1900}
>   model: dishes.menu
>   pk: 12749
> - fields: {location: IROQUOIS, restaurant: Alumni Association   University 
> Of Buffalo,
> status: complete, year: 1900}
>   model: dishes.menu
>   pk: 12826
> - fields: {location: '[CHICAGO', restaurant: Chicago Bar Association, 
> status: complete,
> year: 1900}
>   model: dishes.menu
>   pk: 12836
> - fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: 
> under review,
> year: 1900}
>   model: dishes.menu
>   pk: 12841
> - fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: 
> complete, year: 1900}
>   model: dishes.menu
>   pk: 12960
> - fields: {location: HOTEL MARLBOROUGH, restaurant: District No.3 Catholic 
> Benevolent
>   Legion, status: under review, year: 1900}
>   model: dishes.menu
>   pk: 13076
> - fields: {location: 9 & 10 BATTERY PL. NY, restaurant: Castle Garden 
> Hotel, status: complete,
> year: 1900}
>   model: dishes.menu
>   pk: 13117
>
> Here's the model:
> class Menu(models.Model):
> restaurant=models.TextField(unique=False)
> year=models.IntegerField(unique=False,null=True)
> location=models.TextField(unique=False)
> status=models.CharField(unique=False,max_length=20)
> pk=models.IntegerField(primary_key=True)
> def __unicode__(self):
> return restaurant
> def __period__(self):#adapted from 
> http://stackoverflow.com/questions/2272149/round-to-5or-other-number-in-python
> try:
> p=int(10*round(float(self.year)/10))
> if p < self.year:
> return "%s-%s"%(p,p+5)
> else:
> return "%s-%s"%(p-5,p)
> except:
> return ""
> period=property(__period__) 
> language = models.CharField(unique=False,max_length=30)
>
>
Some recommandations:

- I never defined __XYZ__ except to look elite ;)
- how «return restaurant» in __unicode__ can possibly work ?
- unique default value = False, no need to repeat it if is not something 
else
- according to Django codings standards you should not inter-mix model 
fields with plain properties or methods
- pk=models.IntegerField(primary_key=True) What is it useful for ?
- according to pep8 «except:» should never be used instead use the «except 
MyException» or «except MyException, e» this prevents bugs [2]

> I've got a very tight deadline, and I'm encountering a very frustrating 
>> problem. Every time I try to use loaddata to load my data into my database, 
>> I get the loaddata error in the subject. I've tried YAML, I've tried JSON, 
>> I've tried excerpting only a few lines of each, all to no avail. I'm really 
>> at my rope's end. I don't think my models are flawed in any significant 
>> way--each refers to only one field in one other model (the primary key in 
>> four out of five of them).
>>
>> How big is the json file ? Which library do you use ? If you use 
simplejson it's probably that see: 
https://github.com/simplejson/simplejson/issues/28 This relates to a 
hierarchical data structure where your datastructure at least the one you 
pasted is not, I already had troubles with big JSON files and simplejson, I 
have no metrics sorry.

Can you use SQL ? Maybe you will need to consider spliting the json file 
into several file.

Regards,

Amirouche

[1] 
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#model-style
[2] http://peps.io/8/#programming-recommendations

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FCFXKNxtvAIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Getting Access to Object in Admin Panel

2012-12-30 Thread Amirouche


On Sunday, December 30, 2012 8:47:05 AM UTC+1, donarb wrote:
>
> You can code a string that references the __unicode__ method:
>
>   list_display = ('__unicode__', ...
>
ref: 
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/iJWxqtXmcS0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Serve static files in production server

2012-12-30 Thread Amirouche
Héllo Stefano,

On Sunday, December 30, 2012 1:27:12 PM UTC+1, Stefano Tranquillini wrote:
>
> Hi all.
> in the appfog ML we were fighting again the possibility to serve static 
> file in django without using an external server.
> So far AF does not provide a setup of the server to split the server in 
> static and dynamic (django) folders.
> so, one of the solution is to use this
>
> # urls.py 
> urlpatterns += patterns('', 
> url(r'^static/(?P.*)$', 'django.views.static.serve', { 
> 'document_root': settings.STATIC_ROOT}) 
> )
>
> but, is it ok to use this trick in django or will it lead to problems (aka 
> memory problems and stuff like that)?
>

The documentation state «Again, this view is *not* hardened for production 
use» [1]

What is the particular issue your are facing ? Maybe tproxy [2] can help.

Regards,

Amirouche

[1] 
https://docs.djangoproject.com/en/dev/howto/static-files/#django.views.static.serve
[2] https://github.com/benoitc/tproxy

>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WjCrTrhhcyEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Replicating same model for different deployed application.

2012-12-30 Thread Amirouche
Héllo Subodh

On Sunday, December 30, 2012 3:57:36 AM UTC+1, Subodh Nijsure wrote:
>
> Hi,
>
> I have following situation where. My model consist of say table1, table2, 
> table3. 
>
> I am going to "host" similar data and associated web interface for 
> multiple customers -( customer1, customer2, customer3.) they would access 
> these application as http://hostname/customer1 http://hostname/customer2etc.
>
> When customer1 application is deployed I want tables customer1_table1, 
> customer1_table2, customer1_table3 to be created. Same for customer2, 3 etc.
>
> Right now I am thinking of having one "template" directory where all 
> database names are referred to as replaceme_table1, replaceme_table2 etc.
>
> When I actually deploy application for real customer say customer1 I am 
> copying this template to directory customer1 and running sed to  change 
> 'replaceme' with 'customer1' 
>
> Is there a better, elegant way to do this in django where you have same 
>  model that needs to be deployed as multiple django applications?
>

If I understand this is a multitenant application or multitenancy for 
short, one django instance for several customer. They are several 
application that are labeled like that, I can't recommend any in particular 
since I don't use it them.

Regards,

Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/_np6wETOfSwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Use GraphDB with Django

2012-12-17 Thread Amirouche
Héllo,

What is you progress on the subject ? I answer your questions based on my 
experience of both doing Django, and graph database work with a framework 
like Django.

With the Python package Bulbs/Bulbflow, I can interface graph 
> databases and 
> model my domain objects. http://bulbflow.com/quickstart/#domain-models 
> What I would like to do is to define my domain models in this way and 
> use 
> them to query/update the graph db through my views in Django, instead 
> of 
> going through Django's ORM to the relational database.
>
 

> Has anyone tried to do this? Or do you know what implementation effort 
> would 
> be required on the Django-side to make this bridge? 
>

What you need to do is create a reusable application that will link 
Bulbflow with Django
settings so that you can import the graph object representing the graph. 
It's easy,
it has been done (disclaimer they are all my project and unmaintened so 
far):

- https://github.com/amirouche/Flask-Bulbs
- https://bitbucket.org/amirouche/flask-graphiti

And for django:

- https://bitbucket.org/amirouche/django-graphiti
 
I'm not up-to-date regarding bulbflow but this must be pretty similar work
 

> In particular, I would be interested in how to keep the graph object 
> persistent, 
> in order to use it from within my views. 
>

I don't understand the question fully but basically you issue queries that 
saves you models' nodes and edges.
 
Cheers,
 
 Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/eN02xNDguCMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django performance vs others

2012-10-10 Thread Amirouche Boubekki
2012/10/10 Moonlight <moonlight_13_...@yahoo.com>

> I think this <http://packages.python.org/wheezy.web/tutorial.html> one
> explains how it works.


A quick read make me think it's a bit complex.

Check out the routing benchmark too
http://mindref.blogspot.fr/2012/10/python-web-routing-benchmark.html

If this is legit tests, they are impressive.

Would you mind at least using the django-users@googlegroups.com ML...

Thanks,

Amirouche

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



Re: Managers, Queryset, inheritance and polymorphism

2012-10-09 Thread Amirouche Boubekki
Thx Lachlan, I'm not sure to understand everything, I think I will have to
track this variables in the code to see how they are used.

I found out about my bug, it was the import of a pyc that made all the
machinery buggy.

Thanks,

Amirouche

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



Re: Django performance vs others

2012-10-06 Thread Amirouche Boubekki
ect and a pretty
> low-benefit optimization <http://www.codeirony.com/?p=9>.
> Ok, this is important, but don't over-estimate it.
>

True, most of the time you get the project out as fast as possible, the
client pay the periodic fees including power consumtion fees that might
have been avoided with a more efficient solution. But you are still right,
maybe given a team, working with a certain framework is more interesting
because they can use their knowledge and/or application available in the
market to build a good enough solution in time.


>
> By the way, I had the curiosity to take a look at Python ML 
> entry<http://mail.python.org/pipermail/python-list/2012-September/631384.html>which
>  is called "Fastest web framework" and I the Wheezy
> framework <http://pypi.python.org/pypi/wheezy.web/0.1.304>. The cache 
> api<http://packages.python.org/wheezy.http/userguide.html#content-cache>- for 
> instance - is not something I would call well designed and useable :
>
>
> @response_cache(none_cache_profile)
> def change_price(request):
> ...
> with cache_factory() as cache
> dependency = CacheDependency('list_of_goods')
> dependency.delete(cache)
> return response
>
> Is it working code ? where does the returned response come from and how
> does the 3 lines above can impact it ?
> If you want to turn off the cache you have to change all that logical
> code, not just the @decorator, right ? Seriously, dude.
>

I'm not into cache management particularly and did not read the relevant
doc but it seem to me that this is rather a fine-grained cache, and
load/unloading of cache context... similarly Django does db dispatching
https://docs.djangoproject.com/en/dev/topics/cache/?from=olddocs#database-caching-and-multiple-databases

Regards,


Amirouche

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



Managers, Queryset, inheritance and polymorphism

2012-10-05 Thread Amirouche
Héllo,

I got a problem with manager, some of you may already know it, I try my 
best to like them, if anyone can explain me the purpose of their existence 
I will be so much grateful :)

Like I said, I try my best but:

0) Documentation 
references<https://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers-and-model-inheritance>«default_manager»,
 but I don't find it in the code, is it a documentation 
bug ? 

0bis) What is the purpose of «_default_manager» and «_base_manager» ?

1) What is the purpose of 
«Manager.db<https://github.com/django/django/blob/master/django/db/models/manager.py#L25>»,
 
it's not used in Manager class, so I don't think it's used anywhere else

2) Polymorphism

   - Is there anyone that can debug two level and more of inheritance in 
   
Django-Polymorphic<https://github.com/chrisglass/django_polymorphic/issues/11>
   - I think this a revision of Django Polymorphic that works with that 
   problem, anyone knows the revision hash ?
   - Do you know any other application that does polymorphism the way I 
   need it (with several level of inheritance) ?
   
If they are answers to question 2, I might no need the answer to the 
following questions, I still would like to know.

I have the following models, manager and querysets 
https://gist.github.com/3826531

According to the code of  Manager in 
manager.py<https://gist.github.com/3826531>, 
I just need to override «get_query_set», but here is what I get as results, 
the bug is in the second line:

In [14]: PolymorphicQuerySet(Entry)
> Out[14]: [, , , , 
> , , ]
> In [15]: Entry.objects.all()
> Out[15]: []


What am I doing wrong ?

Thanks,


Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/G20heNLwu6IJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: assign media to models

2012-10-05 Thread Amirouche


On Thursday, October 4, 2012 1:26:07 AM UTC+2, winniehell wrote:
>
> Hi list! 
>
> I have different models with uploaded content. So I made a Media model 
> with a primary key to ContentType to distinguish to which kind of models 
> the media belongs. Now I want to upload the media inline instead of 
> having to add a Media instance first. Can anybody give me a hint how to 
> do this? 
>

I think this involves javascript and creating custom admin views, look for 
that in the Django documentation.

HTH,


Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TAgvxrgNo7wJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: unicode decode errors in loggging on server

2012-10-05 Thread Amirouche

On Friday, October 5, 2012 10:53:24 AM UTC+2, Bram wrote:
>
> Hello all, 
>
>
> My login setup on my server does not enable console logging, only 
> to-file logging (see at the end of this message for the logger setup). 
> However, just now I got a unicode decode error in my logging: 
>
>
>   File "/home/xyz/site/xyz/views.py", line 520, in xx_yy_zz 
> logger.error(u"Successfully decoded data but data is not json: %s" 
> % decoded) 
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xb5 in position 
> 1: ordinal not in range(128) 
>
> I'm a bit puzzled by this as I'm logging only to files, which should 
> be written as UTF-8... 
> If anyone has a clue, let me know! 
>

It's seems like the string you interpolate is not ascii-decodable, try 
unicode.decode(encoding='utf-8') before interpolation
 
Do you know about sentry <https://www.getsentry.com/welcome/> ?


HTH,


Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/KfR1AWoZERsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie Looking for Starter Plugin

2012-10-05 Thread Amirouche

 

> The job description is to have a dashboard full of information, 


It might be an OK solution to use the admin changelist (list feature of the 
admin) and render graphics using admin actions with an intermediate 
page<https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#actions-that-provide-intermediate-pages>and
 using 
filter and search <https://docs.djangoproject.com/en/dev/ref/contrib/admin/>. 
Given you know how to override templates and find you way through the admin 
classes and AdminModel configuration. 
 

> this information could be coming from external sites or our own sensors.
>

If you don't of Django models for your data, then you can make it work 
using django-roa <https://github.com/liberation/django-sneak> (I don't know 
if works with 1.4.1) or 
django-sneak<https://github.com/liberation/django-sneak>(should work with 
1.4.1, contact me if you want help if you go this route) 
and follow the above technic.

Django-reporting <http://Django-Reporting%20might%20also%20be%20usefull>might 
also be useful, but I don't know actually if it is the solution to 
your problem.

Anyway, if you don't feel like to integrate/use this applications which 
might be a bit difficult for a beginner. You can start from scratch CBV 
route <https://docs.djangoproject.com/en/dev/topics/class-based-views/> or 
function views and build a customisable dashboard yourself, I don't have 
all I need to be more precise.

I don't think the admin is the solution, it's not flexible enough but still 
a good solution for a POC application.
 

> This is what strucked me about the admin_tools interface this ability to 
> add, remove and change the layout with relative ease.
>
Yes but it's specific to admin tools I think, someone more competent might 
be of better advice, but I think that admin tools is not the application 
you are looking for. Or ask the maintenair directly through github they 
might be able to answer you :)

I suspect that users will have to be registered so it won't be open to the 
> public to just "sign up" but management have changed their mind before on 
> these type of issues.
>
I don't think this is your primary issue right now, getting the dashboard, 
graphs and data navigation up and running should be. If you go the admin 
way and the management decide that the data should be public, you can 
provide a Django user with default password, lock the change password 
feature and make the credentials available publicly.

If you feel it would be better to go for a cms
>
I say it might be, try to contact their respective maintainer or mailling 
lists.
 

> Or just use the current admin interface as is that would be great as I 
> have very little time allocated to this project being a typical government 
> organisation. 
>
Like everybody ;)
 

> That said I have tasked myself to learn the ways of Django as such I'm 
> feeling a bit overwhelmed on the practices, code structure and the best way 
> forward.
>
You problem doesn't seem to be in the Django CMS-like vein of problems, yet 
it's it's doable, but can't give a precise answer without more information.

Contact me directly if you want.

Good luck


Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FIGB0RvmQ1sJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django testing strategy

2012-10-05 Thread Amirouche


On Friday, October 5, 2012 9:56:34 AM UTC+2, Daniele Procida wrote:
>
> On Thu, Oct 4, 2012, Evan Brumley <voight...@gmail.com > 
> wrote: 
>
> >django-dynamic-fixture can also help a lot in this situation: 
> >http://paulocheque.github.com/django-dynamic-fixture/ 
> > 
> >Certainly beats having to futz around with fixtures. 
>
> Thanks - there seem to be a lot of tools to generate test data in various 
> ways, such as <https://github.com/dnerdy/factory_boy>. 
>
> However I am still puzzled by the question at a slightly higher level, 
> about strategy - is it better to create a large collection of data once, 
> and to test the behviour of the system against the various combinations of 
> data in it, or to create a lengthy succession of smaller collections of 
> data,containing only the material needed for the particular combination 
> being tested each time? 
>

The problem you raising, is I think the problematic of unit-tests which 
tests a specific feature of an application versus integration aka. 
several-applications-wide tests which tests that a user workflow works 
properly like I put create a model, celery process it, then I (or another 
user) change the model, then I send an email, I get an hardbounce etc...). 
Anyway, like I said in the other mail, I do think that manual is better.

HTH,

Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/mrNzXmWemz8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django testing strategy

2012-10-05 Thread Amirouche
ostgresSQL) or similar option 
in you database of choice or (prefered if possible) use in memory 
sqlite<http://stackoverflow.com/questions/3096148/how-to-run-djangos-test-database-only-in-memory>
.

I'm not sure but if you use fixtures and they are created between all the 
tests (classes) the test run speed may increase quiet a bit making it quiet 
-- aweful -- to test the project hence developing it, that's also one of 
the reasons why generic apps are a good idea because they can be developped 
and properly tested separatly, can improve your productivity and  you can 
open-source the generic app ;).


Amirouche

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DTfKg-0SajEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django testing strategy

2012-10-05 Thread Amirouche
Please ignore this message I've hit «Post» by mistake I will edit my post :)
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/0S78LxSWkXoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django testing strategy

2012-10-05 Thread Amirouche


On Thursday, October 4, 2012 7:49:19 PM UTC+2, Daniele Procida wrote:
>
> I have started writing my first tests, for a project that has become 
> pretty large (several thousand lines of source code). 
>

That is too, late! ;-)
 

>
> What needs the most testing - where most of the bugs or incorrect appear 
> emerge - are the very complex interactions between objects in the system. 
>
> To me, the intuitive way of testing would be this: 
>
> * to set up all the objects, in effect creating a complete working 
> database 
> * run all the tests on this database 
>

This method might work even if maintaining the fixture can be extra 
trouble. I never used fixture for doing tests, the useful case might not 
have presented itself but we had another way of doing it.
 

> That's pretty much the way I test things without automated tests: is the 
> output of the system, running a huge database of objects, correct? 
>

Yes, but UT, should also be some kind of a documentation of how the 
projects works, having a pre-built database doesn't give much information 
about how to setup a correct database for the project whereas fine grained 
UT do.

 

> However, I keep reading that I should isolate all my tests. 


Yes, but there might be cases where *tests fixtures are* useful, I don't 
know them.

So I have had a go at creating tests that do that, but it can mean setting 
> up a dozen objects sometimes for a single tiny test, then doing exactly the 
> same thing with one small difference for another test. 
>

Use factories for that. there is factory 
boythat seems to do the job, but I don't 
know its value, we were using our own 
factory and/or build the database manually, like I said earlier 
documenting/testing the way the database should look like  in the tests is 
IMO significant. You can also test the factory which might serve as 
documentation/tests of the proper building of the database something like, 
but it can be OT of UT if the factory is not used in the project code:

def test_build_base_site(self):
Factory.build(Site)
self.assertEquals(Site.objects.count(), 42)

def test_build_section(self):
Factory.build(Section, name='Test Section')
self.assertEquals(Section.objects.all(), 1)

self.assertEquals(Section.objects.all(), 1)
def test_build_article(self):
section = Factory.build('Article')
self.assertEquals(Article.objects.all(), 42)

# etc...

The factory takes some arguments, builds the object you asked for 
I don't know how complex is your schema, the  factory can be recursive so 
it's not problem.
 

 

>
> Often I have to run save() on these objects, because otherwise tests that 
> depend on many-to-many and other database relations won't work. 
>
> That seems very inefficient, to create a succession of complex and 
> nearly-identical test conditions for dozens if not hundreds of tests. 
>
> I'd appreciate any advice. 
>
> Daniele 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/3csuRekSzosJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie Looking for Starter Plugin

2012-10-05 Thread Amirouche
On Friday, October 5, 2012 7:47:01 AM UTC+2, Luke Hovington wrote:
>
> After lots of talk on I'm going to start using Django a project turned up 
> that allowed me to start learning how this all works.
>
> So far I have managed (Via tutorials) to get everything setup and running 
> nicely,
> I have also installed admin_tools which brings me to my question.
>
> Is there any plugin/package that would give me a admin_tool type look for 
> all my users for free?
>
> Things I'm after are..
> * Dashboard Widgets all over the page
> * Ability to remove, add and reorganise 'Widgets'
> * Settings saved for each user
>
> I will in the future need to limit the data shown in the widgets or remove 
> others depending on user permissions, but that could be another days issue.
>
> So before I start looking into how admin_tools does it's awesome stuff 
> and repurposing it, I though I would ask those who have been working with 
> it for while.
> Any suggestions?
>
>  
Are you looking for a Django Nuke <http://phpnuke.org> or PostNuke or 
similar application ?

I don't think it exists, but I'd be happy to be part of any team involving 
building such a thing.

That said Django-CMS and mezzanine provide a widget infrastructure it's 
just not presented like that.

Cheers,

Amirouche 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/MrCIN_oyceYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django performance vs others

2012-10-05 Thread Amirouche Boubekki
>
> I have had no idea until recently that django template are sooo slow...
> other engines do the same... but spent less time. What the cool feature
> prevent it for rendering it faster?


The template parsing I guess, but I'm not sure.

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



Re: NetBeans IDE for Python

2009-02-25 Thread Amirouche aka Mouche

It looks like they plan to give some love to django in the next
release

http://wiki.netbeans.org/Python70Roadmap

here is the pre-beta nb 7
http://bits.netbeans.org/download/6.7/m2/

their is a ruby column but no python ! Hell ! I wonder why ! Is ruby
that mainstream ?

can't try it myself now, hope it helps !


On Feb 26, 5:38 am, Amirouche aka Mouche
<amirouche.boube...@gmail.com> wrote:
> On Feb 4, 10:54 pm, phillc <spyyd...@gmail.com> wrote:
>
> > mine wasnt working exactly as you all described it...
>
> > until i moved my django symlink to someplace else on my python path...
> > and it suddenly worked its really odd.
>
> uhh what do you mean ?
>
> > On Feb 3, 12:49 am, mrsixcount <mrsixco...@gmail.com> wrote:
>
> > > Can't seem to get the auto complete to work when I import
> > > django.db.models as models.  Shows models when I start typing but
> > > after the . nothing in the django model section comes up.  Shows the
> > > master list of python options.  IntegerField isn't in there nor could
> > > I find any of the other ones.  Oh well hopefully it will be out soon
> > > with more support for Django
>
> > > On Jan 17, 3:29 am, Gautam <gkac...@gmail.com> wrote:
>
> > > > There is some problem with the parser recognizing package imports in
> > > > the from ... import ... syntax. What seems to work is if you import
> > > > packages directly as import ... as 
>
> > > > So for the django models import as:
>
> > > > import django.db.models as models
>
> > > > And voila, completion in Netbeans works!
>
> > > > On Nov 20 2008, 5:01 pm, lig <se...@matveenko.ru> wrote:
>
> > > > > On 19 нояб, 21:22, Delta20 <digital_illumin...@yahoo.com> wrote:
>
> > > > > > NetBeans for Python has been released and based on the NB Python
> > > > > > roadmap, it looks interesting for those of us working with Django. I
> > > > > > haven't had much of a chance to play with it yet since it just came
> > > > > > out today, but here's the info for anyone interested:
>
> > > > > > NetBeans IDE for 
> > > > > > Python:http://download.netbeans.org/netbeans/6.5/python/ea/
> > > > > > NB Python Roadmap:http://wiki.netbeans.org/Python
>
> > > > > from django.db import models
>
> > > > > class Page(models.Model):
> > > > >     name    = models. # hitting Ctrl+Space here don't show field type
> > > > > suggestions or anything from imported models package
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: NetBeans IDE for Python

2009-02-25 Thread Amirouche aka Mouche



On Feb 4, 10:54 pm, phillc  wrote:
> mine wasnt working exactly as you all described it...
>
> until i moved my django symlink to someplace else on my python path...
> and it suddenly worked its really odd.

uhh what do you mean ?

> On Feb 3, 12:49 am, mrsixcount  wrote:
>
> > Can't seem to get the auto complete to work when I import
> > django.db.models as models.  Shows models when I start typing but
> > after the . nothing in the django model section comes up.  Shows the
> > master list of python options.  IntegerField isn't in there nor could
> > I find any of the other ones.  Oh well hopefully it will be out soon
> > with more support for Django
>
> > On Jan 17, 3:29 am, Gautam  wrote:
>
> > > There is some problem with the parser recognizing package imports in
> > > the from ... import ... syntax. What seems to work is if you import
> > > packages directly as import ... as 
>
> > > So for the django models import as:
>
> > > import django.db.models as models
>
> > > And voila, completion in Netbeans works!
>
> > > On Nov 20 2008, 5:01 pm, lig  wrote:
>
> > > > On 19 нояб, 21:22, Delta20  wrote:
>
> > > > > NetBeans for Python has been released and based on the NB Python
> > > > > roadmap, it looks interesting for those of us working with Django. I
> > > > > haven't had much of a chance to play with it yet since it just came
> > > > > out today, but here's the info for anyone interested:
>
> > > > > NetBeans IDE for 
> > > > > Python:http://download.netbeans.org/netbeans/6.5/python/ea/
> > > > > NB Python Roadmap:http://wiki.netbeans.org/Python
>
> > > > from django.db import models
>
> > > > class Page(models.Model):
> > > >     name    = models. # hitting Ctrl+Space here don't show field type
> > > > suggestions or anything from imported models package
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Processing a file...

2009-02-13 Thread Amirouche B.

thank you for your answers and the insight into the how servers works.

Using a background process, is kind of a burden for deployement
but let's do it the way it works :D
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Processing a file...

2009-02-12 Thread Amirouche B.

Hello,

I 'd like to process some file before saving it, let's say it's an
audio file that I want to be converted to ogg before it lands in the
database forever.

I tried to run ffmpeg2theora in the save method of the models but this
doesn't work verywell, the testserver hangup after the processing is
done.

## FILE : models.py, ##

class Song:
[...]

def save(self):
super(Song, self).save()
path = self.file.path.split("/")
path, file = path[1:-1], path[-1]
joined_path = "/"
for e in path:
joined_path += e + "/"

os.chdir(joined_path)

res = os.popen("/usr/bin/ffmpeg2theora " + path)

any help ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Must Have Python resources

2008-07-21 Thread Amirouche



On 21 juil, 11:11, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 21-Jul-08, at 1:53 PM, Hussein B wrote:
>
> > Well, I know this question isn't related to Django but I hope it is ok
> > to ask.
> > What are your favourite Python resources?
>
> diveintopython -

how is that book outdated ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Must Have Python resources

2008-07-21 Thread Amirouche



On 21 juil, 14:48, cschand <[EMAIL PROTECTED]> wrote:
> The django book is based on version 0.96 and it last updated on
> December 2007.
>
> Now people are using latest SVN and Version 1.0 is at our door steps

I know that, I'm wondering about diveintopython

> Satheesh
>
> On Jul 21, 5:44 pm, Amirouche <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On 21 juil, 11:11, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> > > On 21-Jul-08, at 1:53 PM, Hussein B wrote:
>
> > > > Well, I know this question isn't related to Django but I hope it is ok
> > > > to ask.
> > > > What are your favourite Python resources?
>
> > > diveintopython -
>
> > how is that book outdated ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Using multiple databases

2008-07-21 Thread Amirouche

Have a look a this http://code.djangoproject.com/ticket/4747 &
http://trac.woe-beti.de/

On 21 juil, 03:04, CPF_ <[EMAIL PROTECTED]> wrote:
> Ben Ford wrote:
> > Hi There,
>
> > It has been possible in the past to use multiple databases with
> > django. There was a branch for it and about a year ago it was bought
> > up to date with trunk. However that branch hasn't seen any activity
> > for some time and is effectively dead. There's now a (low key) effort
> > under way to come up with a new API and to take advantage of the
> > recent work in refactoring the database API to again make it possible
> > to use multiple databases in your django project. As it stands at the
> > moment it's at an early stage, and it's really unlikely that anything
> > significant will happen until django 1.0 arrives.
>
> > My advice based on what you've said above would be to use django's ORM
> > for your authentication (and sessions, permissions, groups etc) if
> > it's a good fit for you. That way you'd get all of the great time
> > saving bits of django (like request.user, perms in the template
> > language, authentication cookies etc). In addition to that  maybe
> > you'd like to think about using a different ORM for talking to the
> > other database. There is a project underway on google code to make
> > using SQLAlchemy easier with django - this might be the way to go.
>
> > I'm not sure what others on this mailing list would think about this
> > approach... I'd certainly be interested to hear any thoughts!
>
> > Cheers,
> > Ben
>
> > 2008/7/20 CPF_ <[EMAIL PROTECTED]
> > >:
>
> >     [EMAIL PROTECTED]  wrote:
> >     > Dan wrote:
>
> >     >>     Most ideally we would like to have it so that the application
> >     >> uses DB1
> >     >>     (defined in the settings.py file) as the main database, but
> >     when
> >     >> it's
> >     >>     down to users, uses DB2.user as the users table.
> >     >>     Currently we are thinking of using raw sql, but that would
> >     only be a
> >     >>     last resort preferably. And at that point I'd be more scrambled
> >     >> on how
> >     >>     to use authenticate together with it.
>
> >     >> If you are using MySQL, you can use the federated engine for tables
> >     >> that are only "symlinks" to real tables in another database but
> >     will
> >     >> act as normal tables when doing regular operations on them.
>
> >     >> It might be possible with other databases too, I don't know.
> >     > Hi Dan, thanks for the reply.
> >     > We are indeed using MySQL, and attemipting to symlink (as the mysql
> >     > documentation at
>
> >    http://dev.mysql.com/doc/refman/5.0/en/symbolic-links-to-tables.html)
> >     > didn't work out ("SQL show index from `users` failed : Table
> >     > 'bingo.users' doesn't exist" is what webmin said)
>
> >     > If you're implying some other technique, I have no idea what you are
> >     > talking about - could you please explain, or redirect to a page
> >     > explaining it?
>
> >     > Thanks.
> >     Sorry for kicking this subject, but I'd really like to have an
> >     answer to
> >     that...
>
> >     Thanks in advance.
>
> > --
> > Regards,
> > Ben Ford
> > [EMAIL PROTECTED] 
> > +447792598685
>
> Hi Ben,
> Thanks a lot for the explanation and the insight. I'll be looking up
> some of those ideas you mentioned, and the way you explain it is really
> the way I would like to do it.
> Currently I started development using a standard auth_users but at some
> time, I would like to use the users database already existing...
> There's the other possibility to change the project originally using the
> database. However, regardless, I would still know the way to use
> multiple databases, and if it will be integrated in the 1.0 release, I
> really believe that I will use the 1.0 a lot. Therefore I'll look for
> that feature.
>
> cpf_
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Unicode errors

2008-07-19 Thread Amirouche B.

it works, I don't know why but...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Unicode errors

2008-07-19 Thread Amirouche B.

here are my models http://dpaste.com/66067/

I use smart_unicode even if it's already UTF-8 and no more error but
nothing appears in the admin detailed view of posts

On 19 juil, 14:49, Amirouche <[EMAIL PROTECTED]> wrote:
> I'm using the trunck version
>
> Environment:
>
> Request Method: GET
> Request URL:http://127.0.0.1:8000/admin/blogfeeds/post/15/
> Django Version: 0.97-newforms-admin-SVN-7977
> Python Version: 2.5.2
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.admin',
>  'blogfeeds']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.middleware.doc.XViewMiddleware')
>
> Template error:
> In template /home/amirouche/local/src/django/django/contrib/admin/
> templates/admin/change_form.html, error at line 19
>    Caught an exception while rendering: 'ascii' codec can't encode
> character u'\u2605' in position 0: ordinal not in range(128)
>    9 : {% block stylesheet %}{% admin_media_prefix %}css/forms.css{%
> endblock %}
>
>    10 :
>
>    11 : {% block coltype %}{% if ordered_objects %}colMS{% else
> %}colM{% endif %}{% endblock %}
>
>    12 :
>
>    13 : {% block bodyclass %}{{ opts.app_label }}-
> {{ opts.object_name.lower }} change-form{% endblock %}
>
>    14 :
>
>    15 : {% block breadcrumbs %}{% if not is_popup %}
>
>    16 : 
>
>    17 :      {% trans "Home" %} 
>
>    18 :      {{ opts.verbose_name_plural|capfirst }}
> 
>
>    19 :      {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{%
> else %} {{ original|truncatewords:"18" }} {% endif %}
>
>    20 : 
>
>    21 : {% endif %}{% endblock %}
>
>    22 :
>
>    23 : {% block content %}
>
>    24 : {% block object-tools %}
>
>    25 : {% if change %}{% if not is_popup %}
>
>    26 :    class="historylink">{% trans "History" %}
>
>    27 :   {% if has_absolute_url %}{% trans
> "View on site" %}{% endif%}
>
>    28 :   
>
>    29 : {% endif %}{% endif %}
>
> Traceback:
> File "/home/amirouche/local/src/django/django/core/handlers/base.py"
> in get_response
>   85.                 response = callback(request, *callback_args,
> **callback_kwargs)
> File "/home/amirouche/local/src/django/django/contrib/admin/sites.py"
> in root
>   144.                 return self.model_page(request, *url.split('/',
> 2))
> File "/home/amirouche/local/src/django/django/views/decorators/
> cache.py" in _wrapped_view_func
>   44.         response = view_func(request, *args, **kwargs)
> File "/home/amirouche/local/src/django/django/contrib/admin/sites.py"
> in model_page
>   161.         return admin_obj(request, rest_of_url)
> File "/home/amirouche/local/src/django/django/contrib/admin/
> options.py" in __call__
>   252.             return self.change_view(request, unquote(url))
> File "/home/amirouche/local/src/django/django/contrib/admin/
> options.py" in change_view
>   581.         return self.render_change_form(request, context,
> change=True, obj=obj)
> File "/home/amirouche/local/src/django/django/contrib/admin/
> options.py" in render_change_form
>   460.         ], context,
> context_instance=template.RequestContext(request))
> File "/home/amirouche/local/src/django/django/shortcuts/__init__.py"
> in render_to_response
>   18.     return HttpResponse(loader.render_to_string(*args,
> **kwargs), **httpresponse_kwargs)
> File "/home/amirouche/local/src/django/django/template/loader.py" in
> render_to_string
>   107.     return t.render(context_instance)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   176.         return self.nodelist.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   751.                 bits.append(self.render_node(node, context))
> File "/home/amirouche/local/src/django/django/template/debug.py" in
> render_node
>   71.             result = node.render(context)
> File "/home/amirouche/local/src/django/django/template/loader_tags.py"
> in render
>   97.         return compiled_parent.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   176.         return self.nodelist.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py

Re: Unicode errors

2008-07-19 Thread Amirouche

I'm using the trunck version

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/admin/blogfeeds/post/15/
Django Version: 0.97-newforms-admin-SVN-7977
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'blogfeeds']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')


Template error:
In template /home/amirouche/local/src/django/django/contrib/admin/
templates/admin/change_form.html, error at line 19
   Caught an exception while rendering: 'ascii' codec can't encode
character u'\u2605' in position 0: ordinal not in range(128)
   9 : {% block stylesheet %}{% admin_media_prefix %}css/forms.css{%
endblock %}


   10 :


   11 : {% block coltype %}{% if ordered_objects %}colMS{% else
%}colM{% endif %}{% endblock %}


   12 :


   13 : {% block bodyclass %}{{ opts.app_label }}-
{{ opts.object_name.lower }} change-form{% endblock %}


   14 :


   15 : {% block breadcrumbs %}{% if not is_popup %}


   16 : 


   17 :  {% trans "Home" %} 


   18 :  {{ opts.verbose_name_plural|capfirst }}



   19 :  {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{%
else %} {{ original|truncatewords:"18" }} {% endif %}


   20 : 


   21 : {% endif %}{% endblock %}


   22 :


   23 : {% block content %}


   24 : {% block object-tools %}


   25 : {% if change %}{% if not is_popup %}


   26 :   {% trans "History" %}


   27 :   {% if has_absolute_url %}{% trans
"View on site" %}{% endif%}


   28 :   


   29 : {% endif %}{% endif %}


Traceback:
File "/home/amirouche/local/src/django/django/core/handlers/base.py"
in get_response
  85. response = callback(request, *callback_args,
**callback_kwargs)
File "/home/amirouche/local/src/django/django/contrib/admin/sites.py"
in root
  144.     return self.model_page(request, *url.split('/',
2))
File "/home/amirouche/local/src/django/django/views/decorators/
cache.py" in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "/home/amirouche/local/src/django/django/contrib/admin/sites.py"
in model_page
  161. return admin_obj(request, rest_of_url)
File "/home/amirouche/local/src/django/django/contrib/admin/
options.py" in __call__
  252. return self.change_view(request, unquote(url))
File "/home/amirouche/local/src/django/django/contrib/admin/
options.py" in change_view
  581. return self.render_change_form(request, context,
change=True, obj=obj)
File "/home/amirouche/local/src/django/django/contrib/admin/
options.py" in render_change_form
  460. ], context,
context_instance=template.RequestContext(request))
File "/home/amirouche/local/src/django/django/shortcuts/__init__.py"
in render_to_response
  18. return HttpResponse(loader.render_to_string(*args,
**kwargs), **httpresponse_kwargs)
File "/home/amirouche/local/src/django/django/template/loader.py" in
render_to_string
  107. return t.render(context_instance)
File "/home/amirouche/local/src/django/django/template/__init__.py" in
render
  176. return self.nodelist.render(context)
File "/home/amirouche/local/src/django/django/template/__init__.py" in
render
  751. bits.append(self.render_node(node, context))
File "/home/amirouche/local/src/django/django/template/debug.py" in
render_node
  71. result = node.render(context)
File "/home/amirouche/local/src/django/django/template/loader_tags.py"
in render
  97. return compiled_parent.render(context)
File "/home/amirouche/local/src/django/django/template/__init__.py" in
render
  176. return self.nodelist.render(context)
File "/home/amirouche/local/src/django/django/template/__init__.py" in
render
  751.     bits.append(self.render_node(node, context))
File "/home/amirouche/local/src/django/django/template/debug.py" in
render_node
  71. result = node.render(context)
File "/home/amirouche/local/src/django/django/template/loader_tags.py"
in render
  97. return compiled_parent.render(context)
File "/home/amirouche/local/src/django/django/template/__init__.py" in
render
  176. return self.nodelist.render(context)
File "/home/amirouche/local/src/django/django/template/__init__.py" in
render
  751. bits.append(self.render_node(node, context))
File "/home/amirouche/local/src/django/django/template/debug.py" in
render_node
  71. result = node.render(context)
File "/home/amirouche/local/src/django

Unicode errors

2008-07-19 Thread Amirouche

I got an encoding error while rendering in the admin some text I
parsed from a feed with feedparser

Caught an exception while rendering: 'ascii' codec can't encode
character u'\u2605'.

everything is utf-8 compliant (db = sqlite3)  so I don't understand,
the error happenned in *force_unicode*.

any tips

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Customizing Django's Auth System

2007-10-18 Thread Amirouche

if you only need User, write you own User model, no ?

On Oct 18, 7:34 pm, "Hugh Bien" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I was wondering if it was possible to customize Django's Auth system to not
> include permissions, groups, or messages.  For the app I'm working on, just
> have a User model would be great.
>
> - Hugh


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



newforms admin branch ?

2007-10-07 Thread Amirouche

Hello,

I'm starting a new project and I'm planning to use a lot django's
admin interface. Since I work with the trunk branch I'm wondering
whether I should use the newforms-admin.

My questions are:
- In which state is currently the newforms-admin
- Should I use it ?
- How should I use id, eg: should I merge the trunk and newforms-admin
branch together.

Regards,

Amirouche B.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   >